Introduction
Accessible components for Solid 2.0, built with UI SDK and Tailwind CSS. Take the source and make it your own.
Solid UI is an unofficial Solid 2.0 port of shadcn/ui.
Build your own component library with code you control.
With a packaged component library, you install a dependency and import its components. As your design system grows, you may need to add wrappers, override styles, or mix components with different APIs. Solid UI gives you the component source so you can make those changes in your own codebase.
Solid UI is built around five principles.
- Open Code. Copy the component source into your project and edit it there.
- Composition. Combine explicit component parts to build the interface you need.
- Distribution. Find the source files and dependencies together in the component registry.
- Beautiful Defaults. Start with accessible components and styles that work together.
- AI-Ready. Give coding tools source files and examples they can inspect and edit.
Open Code
Solid UI hands you the source for each component. You can see how it renders, use it as a starting point, and change its styling or behavior alongside the rest of your app. For a concrete example, try editing your local copy of Button.
Update UI SDK to receive fixes to the behaviors your components use, such as focus management and keyboard navigation. For changes to Solid UIโs component source, compare the updated source with your local copy and merge the changes you want to keep.
Composition
Components expose named parts you can assemble. UI SDK connects those parts and manages interactions like focus and dismissal. For example, you can combine a trigger, content, a title, and an optional description in Dialog.
Distribution
The registry records the source and dependencies behind each component. The Manual installation tab shows the source for the selected style and the dependencies it needs. Try it from any page in the component catalog.
Beautiful Defaults
The components share a visual language so you can combine them in a form, menu, or page. Try the style selector to compare the available presets in light and dark mode. Tailwind CSS classes and shared color tokens give you a starting point for your own design system.
Shared Styles
init writes solid-ui.css from your preset: the theme tokens, fonts, dark mode and the shared utilities the components use, such as state variants, accordion animations, scroll fades and text shimmer. Run it again with --force to switch the preset, see Switch the theme.
To set it up by hand, install the packages the stylesheet imports, save it next to your app stylesheet and import it right after Tailwind CSS. @layer ui-sdk comes first, so your styles and Tailwind utilities override UI SDKโs own CSS.
@layer ui-sdk;
@import "tailwindcss";
@import "./solid-ui.css";The stylesheet below uses the Nova preset. For another one, build it on the Create page and run init with its code.
@import "tw-animate-css";
@import "@fontsource-variable/geist";
@custom-variant dark (&:is(.dark *));
/*!
* Solid UI shared styles, adapted from shadcn/ui.
* Copyright (c) 2023 shadcn
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
@custom-variant data-open (&:where([data-open]:not([data-open="false"])));
@custom-variant data-closed (&:where([data-closed]:not([data-closed="false"])));
@custom-variant data-checked (&:where([data-checked]:not([data-checked="false"])));
@custom-variant data-unchecked (&:where([data-unchecked]:not([data-unchecked="false"])));
@custom-variant data-disabled (&:where([data-disabled]:not([data-disabled="false"])));
@custom-variant data-active (&:where([data-active]:not([data-active="false"])));
@custom-variant data-horizontal (&:where([data-orientation="horizontal"]));
@custom-variant data-vertical (&:where([data-orientation="vertical"]));
@theme inline {
--animate-accordion-down: solid-accordion-down var(--tw-duration, 0.2s)
ease-out;
--animate-accordion-up: solid-accordion-up var(--tw-duration, 0.2s) ease-out;
@keyframes solid-accordion-down {
from {
height: 0;
}
to {
height: var(--accordion-panel-height, auto);
}
}
@keyframes solid-accordion-up {
from {
height: var(--accordion-panel-height, auto);
}
to {
height: 0;
}
}
}
@property --scroll-fade-t {
syntax: "<length-percentage>";
inherits: false;
initial-value: 0px;
}
@property --scroll-fade-b {
syntax: "<length-percentage>";
inherits: false;
initial-value: 0px;
}
@property --scroll-fade-s {
syntax: "<length-percentage>";
inherits: false;
initial-value: 0px;
}
@property --scroll-fade-e {
syntax: "<length-percentage>";
inherits: false;
initial-value: 0px;
}
@property --scroll-fade-mask {
syntax: "*";
inherits: false;
}
@keyframes scroll-fade-reveal-t {
from {
--scroll-fade-t: 0px;
}
to {
--scroll-fade-t: var(--_scroll-fade-size-t);
}
}
@keyframes scroll-fade-reveal-b {
from {
--scroll-fade-b: var(--_scroll-fade-size-b);
}
to {
--scroll-fade-b: 0px;
}
}
@keyframes scroll-fade-reveal-s {
from {
--scroll-fade-s: 0px;
}
to {
--scroll-fade-s: var(--_scroll-fade-size-s);
}
}
@keyframes scroll-fade-reveal-e {
from {
--scroll-fade-e: var(--_scroll-fade-size-e);
}
to {
--scroll-fade-e: 0px;
}
}
@utility scroll-fade-y {
--_scroll-fade-size-t: var(
--scroll-fade-t-size,
var(--scroll-fade-size, min(12%, calc(var(--spacing) * 10)))
);
--_scroll-fade-size-b: var(
--scroll-fade-b-size,
var(--scroll-fade-size, min(12%, calc(var(--spacing) * 10)))
);
--scroll-fade-block: linear-gradient(
to bottom,
transparent 0,
#000 var(--scroll-fade-t, 0px),
#000 calc(100% - var(--scroll-fade-b, 0px)),
transparent 100%
);
-webkit-mask-image: var(--scroll-fade-mask, var(--scroll-fade-block));
mask-image: var(--scroll-fade-mask, var(--scroll-fade-block));
-webkit-mask-composite: source-in;
mask-composite: intersect;
-webkit-mask-repeat: no-repeat;
mask-repeat: no-repeat;
@supports (animation-timeline: scroll()) {
/* Chromium requires a separate timeline declaration after minification. */
animation-name: scroll-fade-reveal-t, scroll-fade-reveal-b;
animation-duration: 1ms;
animation-timing-function: ease-in-out;
animation-timeline: scroll(self y), scroll(self y);
animation-range:
0 var(--scroll-fade-reveal, calc(var(--spacing) * 24)),
calc(100% - var(--scroll-fade-reveal, calc(var(--spacing) * 24))) 100%;
animation-fill-mode: both;
}
@supports not (animation-timeline: scroll()) {
--scroll-fade-t: var(--_scroll-fade-size-t);
--scroll-fade-b: var(--_scroll-fade-size-b);
}
}
@utility scroll-fade-x {
--_scroll-fade-size-s: var(
--scroll-fade-s-size,
var(--scroll-fade-size, min(12%, calc(var(--spacing) * 10)))
);
--_scroll-fade-size-e: var(
--scroll-fade-e-size,
var(--scroll-fade-size, min(12%, calc(var(--spacing) * 10)))
);
--scroll-fade-inline: linear-gradient(
to right,
transparent 0,
#000 var(--scroll-fade-s, 0px),
#000 calc(100% - var(--scroll-fade-e, 0px)),
transparent 100%
);
&:where([dir="rtl"], [dir="rtl"] *) {
--scroll-fade-inline: linear-gradient(
to left,
transparent 0,
#000 var(--scroll-fade-s, 0px),
#000 calc(100% - var(--scroll-fade-e, 0px)),
transparent 100%
);
}
-webkit-mask-image: var(--scroll-fade-mask, var(--scroll-fade-inline));
mask-image: var(--scroll-fade-mask, var(--scroll-fade-inline));
-webkit-mask-composite: source-in;
mask-composite: intersect;
-webkit-mask-repeat: no-repeat;
mask-repeat: no-repeat;
@supports (animation-timeline: scroll()) {
animation-name: scroll-fade-reveal-s, scroll-fade-reveal-e;
animation-duration: 1ms;
animation-timing-function: ease-in-out;
animation-timeline: scroll(self inline), scroll(self inline);
animation-range:
0 var(--scroll-fade-reveal, calc(var(--spacing) * 24)),
calc(100% - var(--scroll-fade-reveal, calc(var(--spacing) * 24))) 100%;
animation-fill-mode: both;
}
@supports not (animation-timeline: scroll()) {
--scroll-fade-s: var(--_scroll-fade-size-s);
--scroll-fade-e: var(--_scroll-fade-size-e);
}
}
@property --shimmer-angle {
syntax: "<angle>";
inherits: true;
initial-value: 20deg;
}
@property --shimmer-image {
syntax: "*";
inherits: false;
}
@property --shimmer-text-fill {
syntax: "*";
inherits: false;
}
@theme inline {
@keyframes tw-shimmer {
from {
background-position: 100% 0;
}
to {
background-position: 0 0;
}
}
}
@utility shimmer {
--_spread: var(--shimmer-spread, calc(3ch + 40px));
--_base: currentColor;
--_highlight: var(
--shimmer-color,
oklch(from currentColor l c h / calc(alpha* 0.2))
);
background-image: var(
--shimmer-image,
linear-gradient(
calc(90deg + var(--shimmer-angle)),
var(--_base) calc(50% - var(--_spread)),
color-mix(in oklch, var(--_highlight), var(--_base) 50%)
calc(50% - var(--_spread) * 0.5),
var(--_highlight) 50%,
color-mix(in oklch, var(--_highlight), var(--_base) 50%)
calc(50% + var(--_spread) * 0.5),
var(--_base) calc(50% + var(--_spread))
)
);
background-repeat: no-repeat;
background-size: calc(200% + var(--_spread) * 2) 100%;
background-position: 0 0;
background-clip: text;
-webkit-background-clip: text;
-webkit-text-fill-color: var(--shimmer-text-fill, transparent);
animation: tw-shimmer var(--shimmer-duration, 2s) linear infinite;
@variant dark {
--_highlight: var(
--shimmer-color,
oklch(from currentColor max(0.8, calc(l + 0.4)) c h / calc(alpha + 0.4))
);
}
&:where([dir="rtl"], [dir="rtl"] *) {
animation-direction: reverse;
}
@media (prefers-reduced-motion: reduce) {
animation: none;
background-image: none;
-webkit-text-fill-color: currentColor;
}
}
@utility shimmer-none {
--shimmer-image: none;
--shimmer-text-fill: currentColor;
}
:root {
--radius: 0.625rem;
--background: oklch(1 0 0);
--foreground: oklch(0.145 0 0);
--card: oklch(1 0 0);
--card-foreground: oklch(0.145 0 0);
--popover: oklch(1 0 0);
--popover-foreground: oklch(0.145 0 0);
--primary: oklch(0.205 0 0);
--primary-foreground: oklch(0.985 0 0);
--secondary: oklch(0.97 0 0);
--secondary-foreground: oklch(0.205 0 0);
--muted: oklch(0.97 0 0);
--muted-foreground: oklch(0.556 0 0);
--accent: oklch(0.97 0 0);
--accent-foreground: oklch(0.205 0 0);
--destructive: oklch(0.577 0.245 27.325);
--border: oklch(0.922 0 0);
--input: oklch(0.922 0 0);
--ring: oklch(0.708 0 0);
--chart-1: oklch(0.87 0 0);
--chart-2: oklch(0.556 0 0);
--chart-3: oklch(0.439 0 0);
--chart-4: oklch(0.371 0 0);
--chart-5: oklch(0.269 0 0);
--sidebar: oklch(0.985 0 0);
--sidebar-foreground: oklch(0.145 0 0);
--sidebar-primary: oklch(0.205 0 0);
--sidebar-primary-foreground: oklch(0.985 0 0);
--sidebar-accent: oklch(0.97 0 0);
--sidebar-accent-foreground: oklch(0.205 0 0);
--sidebar-border: oklch(0.922 0 0);
--sidebar-ring: oklch(0.708 0 0);
}
.dark {
--background: oklch(0.145 0 0);
--foreground: oklch(0.985 0 0);
--card: oklch(0.205 0 0);
--card-foreground: oklch(0.985 0 0);
--popover: oklch(0.205 0 0);
--popover-foreground: oklch(0.985 0 0);
--primary: oklch(0.922 0 0);
--primary-foreground: oklch(0.205 0 0);
--secondary: oklch(0.269 0 0);
--secondary-foreground: oklch(0.985 0 0);
--muted: oklch(0.269 0 0);
--muted-foreground: oklch(0.708 0 0);
--accent: oklch(0.269 0 0);
--accent-foreground: oklch(0.985 0 0);
--destructive: oklch(0.704 0.191 22.216);
--border: oklch(1 0 0 / 10%);
--input: oklch(1 0 0 / 15%);
--ring: oklch(0.556 0 0);
--chart-1: oklch(0.87 0 0);
--chart-2: oklch(0.556 0 0);
--chart-3: oklch(0.439 0 0);
--chart-4: oklch(0.371 0 0);
--chart-5: oklch(0.269 0 0);
--sidebar: oklch(0.205 0 0);
--sidebar-foreground: oklch(0.985 0 0);
--sidebar-primary: oklch(0.488 0.243 264.376);
--sidebar-primary-foreground: oklch(0.985 0 0);
--sidebar-accent: oklch(0.269 0 0);
--sidebar-accent-foreground: oklch(0.985 0 0);
--sidebar-border: oklch(1 0 0 / 10%);
--sidebar-ring: oklch(0.556 0 0);
}
@theme inline {
--font-sans: "Geist Variable", ui-sans-serif, system-ui, sans-serif;
--font-heading: var(--font-sans);
--color-background: var(--background);
--color-foreground: var(--foreground);
--color-card: var(--card);
--color-card-foreground: var(--card-foreground);
--color-popover: var(--popover);
--color-popover-foreground: var(--popover-foreground);
--color-primary: var(--primary);
--color-primary-foreground: var(--primary-foreground);
--color-secondary: var(--secondary);
--color-secondary-foreground: var(--secondary-foreground);
--color-muted: var(--muted);
--color-muted-foreground: var(--muted-foreground);
--color-accent: var(--accent);
--color-accent-foreground: var(--accent-foreground);
--color-destructive: var(--destructive);
--color-border: var(--border);
--color-input: var(--input);
--color-ring: var(--ring);
--color-chart-1: var(--chart-1);
--color-chart-2: var(--chart-2);
--color-chart-3: var(--chart-3);
--color-chart-4: var(--chart-4);
--color-chart-5: var(--chart-5);
--color-sidebar: var(--sidebar);
--color-sidebar-foreground: var(--sidebar-foreground);
--color-sidebar-primary: var(--sidebar-primary);
--color-sidebar-primary-foreground: var(--sidebar-primary-foreground);
--color-sidebar-accent: var(--sidebar-accent);
--color-sidebar-accent-foreground: var(--sidebar-accent-foreground);
--color-sidebar-border: var(--sidebar-border);
--color-sidebar-ring: var(--sidebar-ring);
--radius-sm: calc(var(--radius) * 0.6);
--radius-md: calc(var(--radius) * 0.8);
--radius-lg: var(--radius);
--radius-xl: calc(var(--radius) * 1.4);
--radius-2xl: calc(var(--radius) * 1.8);
--radius-3xl: calc(var(--radius) * 2.2);
--radius-4xl: calc(var(--radius) * 2.6);
}
@layer base {
* {
@apply border-border outline-ring/50;
}
body {
@apply bg-background text-foreground;
}
}
AI-Ready
Coding tools can read the same component files you edit. Point them to an existing component and its examples when you want to build a new variation. Named parts and shared styling patterns give the tool concrete conventions to follow.