Konsta UI Documentation
repository·master·Indexed 26 days ago
https://github.com/konstaui/konstaA library of pixel-perfect mobile UI components built with Tailwind CSS for React, Vue, and Svelte. It provides high-fidelity iOS and Material Design styles for mobile-first web applications. Version 5.3.0 includes comprehensive color utilities for Material Design, including HCT color space manipulation, CAM16 color instances, and dynamic color generation via ColorSpecDelegateImpl2021 and ColorSpecDelegateImpl2025.
What's inside Konsta UI
- Konsta UI provides pixel-perfect mobile UI components built with Tailwind CSS. It offers components designed for both iOS and Material Design styles and is compatible with React, Vue, and Svelte frameworks.
Access Konsta UI Documentation
masterDetailed documentation, including installation guides and component usage, is available at the official website: https://konstaui.comDevelop Konsta UI from source
masterTo start developing Konsta UI, first install all necessary dependencies using npm.
$ npm installUse Material Color Utilities
masterThematerial-color-utilitiespackage provides a comprehensive suite of tools for color manipulation, dynamic color generation, and accessibility checking. It is used for implementing Material Design color systems, including HCT color space conversions, tonal palettes, and dynamic color schemes based on source colors.Use Konsta UI Vue components
masterKonsta UI provides a comprehensive set of Vue components for building mobile-style interfaces. You can import components using either their prefixed names (e.g.,
kButton) or their PascalCase aliases (e.g.,Button).Available Components
Layout & Containers
App(kApp): The root application component.Page(kPage): A container for page content.Navbar(kNavbar): Navigation bar.NavbarBackLink(kNavbarBackLink): Back link for navigation bars.Tabbar(kTabbar): Tab bar for navigation.TabbarLink(kTabbarLink): Individual tab links.Panel(kPanel): Side panels.Sheet(kSheet): Bottom sheets.Toolbar(kToolbar): Bottom or top toolbars.ToolbarPane(kToolbarPane): Panes within a toolbar.Block(kBlock): Content blocks with header, footer, and title.Card(kCard): Card containers.Glass(kGlass): Glassmorphism effect container.
Navigation & Selection
Breadcrumbs(kBreadcrumbs): Breadcrumb navigation.BreadcrumbsItem(kBreadcrumbsItem): Individual breadcrumb items.BreadcrumbsSeparator(kBreadcrumbsSeparator): Separator for breadcrumbs.BreadcrumbsCollapsed(kBreadcrumbsCollapsed): Collapsed breadcrumb state.Segmented(kSegmented): Segmented control.SegmentedButton(kSegmentedButton): Individual buttons within a segmented control.Stepper(kStepper): Stepper component.
Lists & Menus
List(kList): List container.ListGroup(kListGroup): Grouping for list items.ListItem(kListItem): Individual list items.ListButton(kListButton): Clickable list items.ListInput(kListInput): Input fields within a list.MenuList(kMenuList): Menu list container.MenuListItem(kMenuListItem): Individual menu items.Actions(kActions): Actions container.ActionsGroup(kActionsGroup): Grouping for action buttons.ActionsButton(kActionsButton): Individual action buttons.ActionsLabel(kActionsLabel): Label for actions.
Data Display & Feedback
Badge(kBadge): Status badges.Chip(kChip): Chip components.Icon(kIcon): Icon component.Table(kTable): Table container.TableHead(kTableHead): Table header.TableBody(kTableBody): Table body.TableRow(kTableRow): Individual table rows.TableCell(kTableCell): Individual table cells.Preloader(kPreloader): Loading indicator.Progressbar(kProgressbar): Progress bar.Notification(kNotification): Notification component.Toast(kToast): Toast messages.
Form Elements
Button(kButton): Standard buttons.Link(kLink): Text links.Checkbox(kCheckbox): Checkbox inputs.Radio(kRadio): Radio button inputs.Toggle(kToggle): Switch/Toggle inputs.Range(kRange): Range slider inputs.Searchbar(kSearchbar): Search input bar.
Overlays & Dialogs
Dialog(kDialog): Modal dialogs.DialogButton(kDialogButton): Buttons within a dialog.Popover(kPopover): Popover overlays.Popup(kPopup): Popup overlays.Messages(kMessages): Message list container.MessagesTitle(kMessagesTitle): Title for message lists.Message(kMessage): Individual message bubble.Messagebar(kMessagebar): Input bar for messages.
Utilities
Provider(kProvider): Context provider for theme and configuration.useTheme: Hook to access theme information.useThemeClasses: Hook to access theme-specific CSS classes.
Run the React Kitchen Sink
masterTo run the Kitchen Sink (a comprehensive component showcase) in a development environment, use thereactnpm script. This will build the development version of the Konsta UI React package before running the showcase.Build production versions of Konsta UI
masterUse thebuildnpm script to create production versions of the library. The compiled results are output to thepackage/folder.Generate a TonalPalette from Hue and Chroma
masterUseTonalPalette.fromHueAndChroma(hue, chroma)to create a palette by specifying the desired hue and chroma directly. This is useful when you want to build a palette around specific color properties without an initial color value.Create a CAM16 color instance from JCH coordinates
masterUseCam16.fromJch(j, c, h)to create an instance using lightness (j), chroma (c), and hue (h). To specify viewing conditions, useCam16.fromJchInViewingConditions(j, c, h, viewingConditions).Translate HCT colors to different viewing conditions
masterUse the
inViewingConditions(vc)method to calculate how a color will appear under different lighting or environmental settings. This method uses the CAM16 color appearance model to account for color relativity (how colors change appearance based on surroundings and lighting).Pass a
ViewingConditionsobject (created viaViewingConditions.make()) to the method to receive a newHctinstance representing the color in those conditions.Convert L* (Lightness) values to ARGB
masterUseargbFromLstar(lstar)to create a grayscale ARGB color that matches a specific perceptual lightness value ($L^*$).Use KonstaProvider for Svelte applications
masterWrap your Svelte application withKonstaProviderto provide the necessary context for Konsta UI components. This is essential for theme management and component styling.