solid-ui
repository·main·Indexed 23 days ago
https://github.com/stefan-karger/solid-uiA collection of accessible, copy-pasteable UI components for SolidJS, inspired by shadcn/ui and tremor-raw. It provides a CLI for initializing projects and adding components like accordions, buttons, dialogs, and charts. The library includes a component registry with core UI elements and examples, as well as utility components for SEO (MetaTags), layouts (PageHeader), and an SVG icon library.
What's inside solid-ui
- SolidUI is an unofficial port of shadcn/ui and tremor-raw specifically for the SolidJS ecosystem. It provides accessible and customizable components designed to be copied and pasted directly into your applications, allowing you to build your own custom component library.
About the Date Picker component
mainThe Date Picker component provides date selection capabilities, including support for date ranges and presets. It is built on top of Ark UI.Create a responsive Dialog/Drawer
mainTo create a component that adapts to screen size, you can combine theDialogandDrawercomponents. This pattern allows you to render a standardDialogon desktop devices and aDraweron mobile devices, providing a more native-feeling experience for mobile users.Understand the solid-ui usage model
mainsolid-ui is not a component library that you install as an npm dependency. Instead, it is a collection of re-usable components designed to be copied and pasted directly into your own SolidJS applications.
To use solid-ui:
- Browse the available components.
- Pick the components you need.
- Copy and paste the source code into your project.
- Customize the code to fit your specific requirements.
This approach allows you to own the code and maintain full control over its implementation, similar to the patterns used by shadcn/ui and tremor-raw.
Support for Deno in @solid-ui/cli
mainAs of version0.7.2, the@solid-ui/clisupports running in a Deno environment.How the Sidebar component structure works
mainThe
Sidebarcomponent is a composite system designed for flexibility and state management. It is composed of the following parts:SidebarProvider: Manages the collapsible state of the sidebar.Sidebar: The main container for the sidebar UI.SidebarHeader: A sticky component for the top of the sidebar.SidebarFooter: A sticky component for the bottom of the sidebar.SidebarContent: The scrollable area for sidebar items.SidebarGroup: A logical section withinSidebarContent.SidebarTrigger: A component used to toggle the sidebar's collapsible state.
Recommended project structure for solid-ui
mainFor optimal organization with
solid-ui, follow this directory structure:src/components/ui/: Contains the generated UI components (e.g.,button.tsx,input.tsx).src/components/: Contains your application-specific components (e.g.,main-nav.tsx).src/lib/: Contains utility functions, specificallyutils.tswhich should define thecnhelper.src/app.css: Your global styles.src/app.tsx: Your application entry point.
Install the Dialog component
mainYou can install the Dialog component using the
solidui-clior by manual installation.Using the CLI
Run the following command to add the component to your project:
npx solidui-cli@latest add dialogManual Installation
- Install the required dependency:
npm install @kobalte/core- Copy the component source code directly into your project files.
Install the Breadcrumb component
mainYou can install the Breadcrumb component using the
solidui-clior by manually copying the source code into your project.Using CLI:
npx solidui-cli@latest add breadcrumbAdd components using the CLI
mainUse the
addcommand to install specific components and their required dependencies into your project.When running the command without a specific component name, you will be presented with an interactive list of available components. You can use the arrow keys to navigate,
Ato toggle all components, andEnterto submit your selection.npx solidui-cli@latest add [component]Install the Navigation Menu component
mainYou can install the
navigation-menucomponent using thesolidui-clior by manual installation.Using the CLI
Run the following command to add the component to your project:
npx solidui-cli@latest add navigation-menuManual Installation
- Install the required dependency:
npm install @kobalte/core- Copy the component source code into your project files.
Access the Figma UI Kit
mainThesolid-uicomponents are recreated in a Figma UI Kit, which includes customizable props, typography, and icons. You can access the open-sourced Figma UI Kit by Pietro Schirano via the Figma Community link below.