MaterialKit
Material design components for iOS written in Swift
Install / Use
/learn @nghialv/MaterialKitREADME
MaterialKit
NOTE: This project is unmaintained.
Material design components (inspired by Google Material Design) for iOS written in Swift
Please feel free to make pull requests.
Features
-
Highly customizable
-
Complete example
-
Supports @IBDesignable to live-render the component in the Interface Builder
-
By supporting @IBInspectable, the class properties can be exposed in the Interface Builder, and you can edit these properties in realtime
-
[x] MKButton: floating action button, raised button, flat button, ripple effect
-
[x] MKTextField: ripple effect, floating placeholder
-
[x] MKTableViewCell
-
[x] MKLabel
-
[x] MKImageView
-
[x] MKLayer
-
[x] MKColor
-
[x] MKActivityIndicator
-
[x] MKRefreshControl
-
[x] MKNavigationBar
Components
MKButton
<p align="center"> <img style="-webkit-user-select: none;" src="./Assets/MKButton.gif" width="320" height="628"> </p>- There are 3 types of main buttons:
Floating Action Button,Raised Button,Flat Button - Customizable attributes: color, ripple location, animation timing function, animation duration...
let button = MKButton(frame: CGRect(x: 10, y: 10, width: 100, height: 35))
button.maskEnabled = true
button.rippleLocation = .TapLocation
button.rippleLayerColor = UIColor.MKColor.LightGreen
MKTextField
<p align="center"> <img style="-webkit-user-select: none;" src="https://dl.dropboxusercontent.com/u/8556646/MKTextField.gif" width="365" height="568"> </p> <p align="center"> <img style="-webkit-user-select: none;" src="https://dl.dropboxusercontent.com/u/8556646/MKTextField_bottomborder.gif" width="365" height="111"> </p>- Single-line text field
- Floating placeholder
- Ripple Animation
- Customizable attributes: color, ripple location, bottom border, animation timing function, animation duration...
textField.rippleLocation = .Left
textField.floatingPlaceholderEnabled = true
textField.placeholder = "Description"
textField.layer.borderColor = UIColor.MKColor.Green.CGColor
textField.rippleLayerColor = UIColor.MKColor.LightGreen
MKTableViewCell
<p align="center"> <img style="-webkit-user-select: none;" src="./Assets/MKTableViewCell.gif" width="320" height="628"> </p>- Customizable attributes: color, ripple location, animation timing function, animation duration...
var cell = tableView.dequeueReusableCellWithIdentifier("MyCell") as MyCell
cell.rippleLocation = .Center
cell.rippleLayerColor = UIColor.MKColor.Blue
MKRefreshControl
<p align="center"> <img style="-webkit-user-select: none;" src="./Assets/MKRefreshControl.gif" width="320" height="628"> </p>- Customizable attributes: color, height
var refreshControl = MKRefreshControl()
refreshControl.addToScrollView(self.tableView, withRefreshBlock: { () -> Void in
self.tableViewRefresh()
})
refreshControl.beginRefreshing()
MKImageView (BarButtonItem), MKActivityIndicator
<p align="center"> <img style="-webkit-user-select: none;" src="./Assets/MKImageView+MKActivityIndicator.gif" width="328" height="628"> </p>-
Customizable attributes: color, ripple location, animation timing function, animation duration...
-
Play ripple animation whenever you want by calling
animateRipplemethod or by settinguserInteractionEnabled = trueripple animation will be played when the label/imageview is tapped -
Easy to customize UIBarButtonItem or UITabBarButton by using MKLabel or MKImageView
// customize UIBarButtonItem by using MKImageView
let imgView = MKImageView(frame: CGRect(x: 0, y: 0, width: 44, height: 32))
imgView.image = UIImage(named: "uibaritem_icon.png")
imgView.rippleLocation = .Center
imgView.userInteractionEnabled = true
let rightBarButton = UIBarButtonItem(customView: imgView)
self.navigationItem.rightBarButtonItem = rightBarButton
MKLayer
A subclass of CALayer.
MKColor
A category for UIColor that adds some methods to get flat colors designed by Google
// get color from UIColor
let lightBlueColor = UIColor.MKColor.LightBlue
MKNavigationBar
A custom UINavigationBar which supports elevation and adding a tint above itself
- Customizable attributes: color, dark color, elevation, shadow opacity, tint color...
- Set the class of the navigation bar in the storyboard designer to MKNavigationBar and set the custom properties
MKSwitch
On/off switches toggle the state of a single settings option. The option that the switch controls, as well as the state it’s in, should be made clear from the corresponding inline label. Switches take on the same visual properties of the radio button.
Installation
- Installation with CocoaPods
pod 'MaterialKit', '~> 0.4'
- Copying all the files into your project
- Using submodule
Requirements
- iOS 8.0+
- Xcode 6.1
License
MaterialKit is released under the MIT license. See LICENSE for details.
Related Skills
clearshot
Structured screenshot analysis for UI implementation and critique. Analyzes every UI screenshot with a 5×5 spatial grid, full element inventory, and design system extraction — facts and taste together, every time. Escalates to full implementation blueprint when building. Trigger on any digital interface image file (png, jpg, gif, webp — websites, apps, dashboards, mockups, wireframes) or commands like 'analyse this screenshot,' 'rebuild this,' 'match this design,' 'clone this.' Skip for non-UI images (photos, memes, charts) unless the user explicitly wants to build a UI from them. Does NOT trigger on HTML source code, CSS, SVGs, or any code pasted as text.
openpencil
2.1kThe world's first open-source AI-native vector design tool and the first to feature concurrent Agent Teams. Design-as-Code. Turn prompts into UI directly on the live canvas. A modern alternative to Pencil.
openpencil
2.1kThe world's first open-source AI-native vector design tool and the first to feature concurrent Agent Teams. Design-as-Code. Turn prompts into UI directly on the live canvas. A modern alternative to Pencil.
ui-ux-designer
Use this agent when you need to design, implement, or improve user interface components and user experience flows. Examples include: creating new pages or components, improving existing UI layouts, implementing responsive designs, optimizing user interactions, building forms or dashboards, analyzing existing UI through browser snapshots, or when you need to ensure UI components follow design system standards and shadcn/ui best practices.\n\n<example>\nContext: User needs to create a new dashboard page for team management.\nuser: "I need to create a team management dashboard where users can view team members, invite new members, and manage roles"\nassistant: "I'll use the ui-ux-designer agent to design and implement this dashboard with proper UX considerations, using shadcn/ui components and our design system tokens."\n</example>\n\n<example>\nContext: User wants to improve the user experience of an existing form.\nuser: "The signup form feels clunky and users are dropping off. Can you improve it?"\nassistant: "Let me use the ui-ux-designer agent to analyze the current form UX and implement improvements using our design system and shadcn/ui components."\n</example>\n\n<example>\nContext: User wants to evaluate and improve existing UI.\nuser: "Can you take a look at our pricing page and see how we can make it more appealing and user-friendly?"\nassistant: "I'll use the ui-ux-designer agent to take a snapshot of the current pricing page, analyze the UX against Notion-inspired design principles, and implement improvements using our design tokens."\n</example>
