A Svelte 5 component library driven by Figma M3 Expressive tokens
Browse the components, their props, and live examples. Every component references Material 3 Expressive tokens — light and dark modes come for free.
Install
bun add @davidhorn/justinbun add @davidhorn/justinUsage
Import the components and the styles bundle, then use them anywhere.
<script>
import { DhButton, DhTextInput } from '@davidhorn/justin';
import '@davidhorn/justin/styles';
let name = $state('');
</script>
<DhTextInput bind:value={name} label="Your name" />
<DhButton variant="primary" text="Submit" />Components
Action
Input
- DhTextInput Outlined text field with label, helper / error, and inline start/end icons. All HTML validation attributes pass through. Draft
- DhSelectInput Native <select> with options array or custom optgroup children. Platform owns the option list — keyboard, touch, and AT all work. Draft
- DhTextArea Multi-line text input with auto-grow, maxRows, and resize modes. Draft
- DhDateInput Native <input type="date"> with calendar icon, min/max as ISO string or Date, and the input-family label/helper/error pattern. Draft
- DhToggle Switch built on native <input type="checkbox" role="switch"> — full form participation and keyboard out of the box. Draft
Feedback
- DhModal Native <dialog> with sizes, slots (header / body / footer), and a confirmation pattern. Browser handles focus trap + aria-modal + ESC. Draft
- DhSpinner CSS-only loading ring. currentColor tinting; size as preset (sm/md/lg/xl), pixel number, or any CSS length. Draft
- DhTag Small semantic status pill. Neutral / info / success / warning / error. Optional icon. Draft
Foundations
- DhIcon Inline SVG icon from the Lucide set (lucide.dev). currentColor tinting; preset sizes 16/20/24/32 plus arbitrary CSS lengths. Draft
- Colors The Material 3 Expressive colour scheme — both light and dark. Every component references these tokens; there are no hardcoded colours in the library. Draft