Install
Web — React + Tailwind CSS v4
Works with Next.js, Vite, Remix… anything that runs Tailwind v4.
npm install @bilursag/solidui-react@import "tailwindcss";
@import "@bilursag/solidui-react/styles.css";import { Button, Card, CardHeader, CardTitle, Field, Input } from '@bilursag/solidui-react';
export function SignUp() {
return (
<Card>
<CardHeader><CardTitle>Create an account</CardTitle></CardHeader>
<Field label="Email" hint="We never share it.">
<Input type="email" placeholder="you@example.com" />
</Field>
<Button block>Continue</Button>
</Card>
);
}- Dark mode: add the
darkclass to<html>or any ancestor (lightforces light inside a dark area). - Next.js App Router: the components are marked
'use client', so Server Components can render them. - Your own fonts: import
@bilursag/solidui-react/no-fonts.cssand set--sui-font-rounded/--sui-font-heading.
React Native — Expo + NativeWind v4
The same components and API, with Reanimated springs and haptics.
npx expo install @bilursag/solidui-native nativewind react-native-reanimated react-native-worklets expo-haptics expo-linear-gradient expo-font
npm install -D tailwindcss@^3.4module.exports = {
content: [
'./App.tsx',
'./src/**/*.{ts,tsx}',
'./node_modules/@bilursag/solidui-native/lib/**/*.js', // the classes SolidUI uses
],
presets: [require('nativewind/preset'), require('@bilursag/solidui-native/tailwind-preset')],
};import './global.css';
import { useFonts } from 'expo-font';
import { useColorScheme } from 'react-native';
import { Button, ThemeProvider } from '@bilursag/solidui-native';
import { fonts } from '@bilursag/solidui-native/fonts';
export default function App() {
const [loaded] = useFonts(fonts);
const scheme = useColorScheme() === 'dark' ? 'dark' : 'light';
if (!loaded) return null;
return (
<ThemeProvider scheme={scheme}>
<Button onPress={() => {}}>Continue</Button>
</ThemeProvider>
);
}Set up NativeWind as usual: jsxImportSource: 'nativewind' in babel.config.js, withNativeWind in metro.config.js (pass inlineRem: 16 so rem spacing matches the web) and a global.css with the three @tailwind directives.
Theming
npx @bilursag/solidui-tokens theme --brand "#0a7d5a" --out src/solidui-theme.css
# ✓ 56 contrast checks pass (WCAG AA)
/* globals.css */
@import "tailwindcss";
@import "@bilursag/solidui-react/styles.css";
@import "./solidui-theme.css";import { createTheme, ThemeProvider } from '@bilursag/solidui-native';
// Outside render
const theme = createTheme({ brand: '#0a7d5a' });
<ThemeProvider scheme={scheme} theme={theme}>
…
</ThemeProvider>createTheme({
brand: '#0a7d5a', // or { light: '#0053cc', dark: '#1f6bff' }
accent: '#22d3fe', // second gradient color (default: a neighbouring hue that keeps on-brand legible)
colors: { light: { 'brand-tint': '…' } }, // exact overrides per token and scheme
fonts: { rounded: '"Inter", sans-serif' },// web font stacks
});
checkContrast(theme); // [{ scheme, fg, bg, ratio, min, pass }, …]
themeVars(theme, 'light'); // { '--sui-brand': '#0a7d5a', … } for a style propColors
bg-surface, text-ink-2, bg-brand-tint…Surfaces
Back to front. No borders: fills and shadows do the separating.
Ink
ink and ink-2 are text (≥ 4.5:1). ink-3 is for icons, placeholders and decoration only (≥ 3:1).
Brand
Derived from one color. brand for fills with on-brand text; brand-ink for brand-colored text and icons.
Status
Each status has a fill, a tint (soft background) and an ink (text on the tint).
Brand gradient
brand → brand-2, for headers and highlights (bg-brand-gradient).
WCAG contrast
The 56 checks (both schemes) that every theme runs. The build fails if the default theme misses one; the theme CLI refuses to write a theme that does.
| Text / background | Sample | Minimum | Light | Dark |
|---|---|---|---|---|
| ink / canvas | AaAa | 4.5:1 | 17.79 | 17.41 |
| ink / surface | AaAa | 4.5:1 | 18.42 | 15.35 |
| ink-2 / surface | AaAa | 4.5:1 | 5.63 | 6.92 |
| ink-2 / canvas | AaAa | 4.5:1 | 5.44 | 7.85 |
| ink-2 / fill | AaAa | 4.5:1 | 4.94 | 6.21 |
| ink-2 / fill-strong | AaAa | 4.5:1 | 4.59 | 5.50 |
| ink-3 / surface | AaAa | 3:1 | 3.53 | 4.32 |
| ink-3 / canvas | AaAa | 3:1 | 3.41 | 4.90 |
| ink-3 / fill | AaAa | 3:1 | 3.09 | 3.88 |
| on-brand / brand | AaAa | 4.5:1 | 6.36 | 5.20 |
| on-brand / brand-hover | AaAa | 4.5:1 | 7.64 | 5.91 |
| on-brand / brand-press | AaAa | 4.5:1 | 9.13 | 6.75 |
| on-brand / brand-2 | AaAa | 3:1 | 4.50 | 4.59 |
| brand-ink / surface | AaAa | 4.5:1 | 6.36 | 5.12 |
| brand-ink / canvas | AaAa | 4.5:1 | 6.14 | 5.81 |
| brand-ink / fill | AaAa | 4.5:1 | 5.57 | 4.59 |
| brand-ink / brand-tint | AaAa | 4.5:1 | 5.49 | 4.87 |
| focus / surface | AaAa | 3:1 | 6.36 | 5.12 |
| focus / canvas | AaAa | 3:1 | 6.14 | 5.81 |
| on-danger / danger | AaAa | 4.5:1 | 4.54 | 4.54 |
| on-danger / danger-hover | AaAa | 4.5:1 | 5.53 | 5.53 |
| danger-ink / surface | AaAa | 4.5:1 | 5.53 | 7.46 |
| danger-ink / canvas | AaAa | 4.5:1 | 5.34 | 8.46 |
| danger-ink / danger-tint | AaAa | 4.5:1 | 4.85 | 7.53 |
| success-ink / surface | AaAa | 4.5:1 | 5.40 | 9.44 |
| success-ink / success-tint | AaAa | 4.5:1 | 4.82 | 8.63 |
| warning-ink / surface | AaAa | 4.5:1 | 5.93 | 10.95 |
| warning-ink / warning-tint | AaAa | 4.5:1 | 5.43 | 10.13 |
Typography
import { typeScale, textMetrics } from '@bilursag/solidui-tokens'Make it soft
Everything at hand
Order summary · 3 items
Body text: descriptions, paragraphs and main content.
Secondary text under a title or in dense lists.
Field label
Small print: hints, dates, metadata.
COUNTER · BADGE
Continue to checkout
// Web: the class brings size + line height (+ tracking on titles)
<h2 className="font-heading text-title font-bold">Your orders</h2>
<p className="text-body-sm font-medium text-ink-2">3 this month</p>
// React Native with @bilursag/solidui-native
<Text variant="title">Your orders</Text>
<Text variant="body-sm">3 this month</Text>
// React Native with StyleSheet
const styles = StyleSheet.create({ title: { ...textMetrics('title'), fontFamily: 'Montserrat-Bold' } });Radii and heights
Radii
Classes rounded-item, rounded-row, rounded-card…
Control heights
Classes h-control-md, size-control-sm… (on native too).
Elevation
Motion
Pills scale to 0.97; round buttons give more, to 0.92.
Input and Field
import { Input, Field } from '@bilursag/solidui-react'At least 8 characters.
That number is not valid.
At least 8 characters.
That number is not valid.
| Prop | Type | Default | Description |
|---|---|---|---|
| size | 'sm' | 'md' | 'lg' | 'md' | Height: 44 · 52 · 56 px. |
| leading / trailing | ReactNode | — | An icon or small button at the start or end (show password, for instance). |
| invalid | boolean | — | Error ring. Inside <Field error> it turns on by itself. |
| className | string | — | Goes to the wrapper; the <input> inherits its typography (font-mono, uppercase…). |
| Field.label / hint / error | ReactNode | — | Label, hint and error, connected through id and aria-describedby. |
| Field.optional | boolean | ReactNode | — | true shows "(optional)" next to the label; pass text to translate it. |
<Field label="Email" hint="We'll send the receipt here." error={errors.email}>
<Input type="email" leading={<Mail />} {...register('email')} />
</Field>
<Field label="Código" optional="(opcional)">
<Input />
</Field>Card
import { Card, CardHeader, CardTitle, CardDescription, CardContent, CardFooter } from '@bilursag/solidui-react'Default
Surface with a soft shadow.
Muted
For grouping inside another card.
Brand
Highlights in the brand color.
Interactive
Hover and press it.
Default
Surface with a soft shadow.
Muted
For grouping inside another card.
Brand
Highlights in the brand color.
Interactive
Hover and press it.
| Prop | Type | Default | Description |
|---|---|---|---|
| variant | 'default' | 'muted' | 'brand' | 'default' | Surface with shadow, gray fill, or brand color. |
| padding | 'none' | 'sm' | 'md' | 'lg' | 'md' | Padding and gap between children: 16 · 24 · 32 px. |
| interactive | boolean | false | Lifts on hover and gives when pressed. Use it with asChild + a link. |
| asChild | boolean | false | Renders the child with the card styles. |
<Card interactive asChild>
<Link href={`/products/${product.id}`}>
<CardHeader>
<CardTitle>{product.name}</CardTitle>
<CardDescription>{product.price}</CardDescription>
</CardHeader>
</Link>
</Card>
// React Native: pass onPress and the card becomes pressable
<Card onPress={() => router.push(`/products/${product.id}`)}>…</Card>Badge
import { Badge } from '@bilursag/solidui-react'| Prop | Type | Default | Description |
|---|---|---|---|
| variant | 'default' | 'brand' | 'secondary' | 'outline' | 'success' | 'warning' | 'danger' | 'default' | Color. 'destructive' is an alias of 'danger' (shadcn compatibility). |
| asChild | boolean | false | Applies the styles to the child (a link, for instance). |
<Badge variant={order.status === 'PAID' ? 'success' : 'warning'}>{label}</Badge>
// React Native: same variants, icon as a component
<Badge variant="brand" icon={ShoppingBagIcon}>2 items</Badge>QuantityStepper
import { QuantityStepper } from '@bilursag/solidui-react'| Prop | Type | Default | Description |
|---|---|---|---|
| value / defaultValue | number | min | Controlled or uncontrolled value. |
| onValueChange | (value: number) => void | — | Called with the new value after each change. |
| min / max | number | 0 / Infinity | Limits. At a limit the button shakes the number instead of changing it. |
| step | number | 1 | How much each press adds or removes. |
| size | 'sm' | 'md' | 'md' | Button size icon-sm or icon, number in heading or title type. |
| variant | 'secondary' | 'surface' | 'secondary' | Button style. Use surface on gray backgrounds, such as a muted card. |
| decrementLabel / incrementLabel | string | 'Decrease' / 'Increase' | Accessible names of the buttons; translate them. Name the group with aria-label. |
| decrementIcon / incrementIcon | ReactNode | − / + | Your own icons. |
<QuantityStepper
value={tickets}
onValueChange={setTickets}
min={1}
max={10}
aria-label="Tickets"
decrementLabel="Remove one"
incrementLabel="Add one"
/>
// React Native (@bilursag/solidui-native): one "adjustable" element for
// VoiceOver and TalkBack, with a selection tick on each change (haptics={false} to turn it off)
<QuantityStepper value={tickets} onValueChange={setTickets} min={1} max={10} accessibilityLabel="Tickets" />Checkout
Cloud Lamp
Hand-blown glass · Ships in 2 days
Your details
We'll send the receipt to this email.
Only used for your receipt.
This code expired on November 30.