texuli
v0.18.0
Published
Styled Texuli components, layouts and shells.
Maintainers
Readme
texuli
Styled, accessible Svelte 5 components, layouts and app shells from
Texuli, an MIT-licensed component library by Dailybot,
Inc. (Small pieces. Infinite possibilities.). Every component composes an
owned headless primitive from
@texuli/primitives
with the theme engine in
@texuli/tokens, so you get
keyboard support, focus management and theming out of the box.
In the stack: layer L3: owned headless primitives (L1, on the @texuli/core texels) plus the token engine (L2) become styled components and layouts. The domain packages (L4 and up), the agent catalog and the player build on it.
Use it to build Svelte 5 apps, dashboards and sites without writing component behavior or design tokens yourself: 41 component families plus layouts for dashboards, marketing pages, auth and settings, content and mobile.
Status: 0.x release. Texuli is in development. The packages are published to npm as
0.18.0, a pre-1.0 release (1.0.0 will be the first stable release). Under 0.x, a new minor (0.18.0) may contain breaking changes, so pin the exact version or use^0.18.0, which accepts only 0.18.x.
Install
npm install texuli @texuli/tokenspnpm add texuli @texuli/tokens
# or
yarn add texuli @texuli/tokens- Peer dependency:
svelte^5.57.2. - Bundler: the package ships Svelte components that import their own
CSS, so use a Svelte 5 aware setup: Vite with
@sveltejs/vite-plugin-svelte, SvelteKit, or Astro with@astrojs/svelte(in Astro, addvite.ssr.noExternal: ['texuli', /^@texuli\//]). - CSS: import
@texuli/tokens/base.cssonce and apply a theme (below). Component styles load with each component. This import is required: component CSS reads the system tokens (--tx-space-unit,--tx-size-icon-sm,--tx-shape-radius-*…) with no fallback, and onlybase.cssdeclares them, so a host with its own reset that skips it gets controls with no size. Such a host can load@texuli/tokens/system.cssinstead (from0.10.0): the system token defaults alone, with no reset.
Quick start
Wire the tokens once, in your app's entry module:
import '@texuli/tokens/base.css';
import { applyTheme } from '@texuli/tokens/css';
import { loadLibraryTheme } from '@texuli/tokens/library';
loadLibraryTheme('enterprise-neutral').then((theme) => {
applyTheme(document.documentElement, { theme, mode: 'light' });
});Then import components from their subpaths:
<script lang="ts">
import { Button } from 'texuli/button';
import { Card, CardContent, CardHeader, CardTitle } from 'texuli/card';
</script>
<Card>
<CardHeader>
<CardTitle>Invoices</CardTitle>
</CardHeader>
<CardContent>
<Button variant="outline" size="sm" onclick={() => console.log('export')}>
Export
</Button>
</CardContent>
</Card>Each texuli/<family> subpath exports the family's Svelte components, its
variant constants and its class helpers. The root entry (texuli)
re-exports every family except list-item (subpath only); subpaths keep
bundles narrow.
What's inside
Components
| Purpose | Subpaths |
| --- | --- |
| Actions | button (Button, IconButton, ButtonGroup), toggle (Toggle, ToggleGroup), kbd-code (Kbd, Code, CopyButton) |
| Forms | field (Field, Label, Description, FieldError, Form), input (Input, InputGroup, Textarea), choice (Checkbox, Radio, Switch), select, combobox (Combobox, MultiSelect), number-pin (NumberField, PinInput), slider, date (Calendar, DatePicker, DateRangePicker, TimeField), tags-color (TagsInput, ColorPicker), file-upload, rating |
| Overlays | dialog (Dialog, AlertDialog), sheet (Sheet, Drawer, DetailPanel, ResponsiveModal; Header, Body, Footer and CloseButton parts), popover (Popover, HoverCard), tooltip, toast (Toaster), menus (DropdownMenu, ContextMenu, Menubar), command (command palette) |
| Navigation | navigation (NavigationMenu, Breadcrumb, Pagination), sidebar (Sidebar, AppNav), tabs-accordion (Tabs, Accordion, Collapsible), stepper (Stepper, Wizard), toolbar, tree (TreeView) |
| Display | card, alert (Alert, Callout, Banner), badge (Badge, Tag, Chip), avatar (Avatar, AvatarGroup), stat (Stat, KPI), table, timeline, carousel, empty (EmptyState, ErrorState), feedback (Skeleton, Spinner, Progress), list-item (ListItem; subpath only, not in the root entry) |
| Structure | separator-aspect (Separator, AspectRatio, VisuallyHidden), scroll-area, resizable (resizable panels) |
| Icons | icons (ten built-in SVG icons and the Icon component), icons/lucide (optional bridge for apps that already use @lucide/svelte) |
Layouts and shells
| Subpath | What it provides |
| --- | --- |
| layouts/shells | AppShell and DrawerScope |
| layouts/app, layouts/app/{sidebar,dual-sidebar,rail,master-detail,split-view,top-nav} | Application layouts |
| layouts/dashboard | DashboardGridLayout and AnalyticsGrid |
| layouts/marketing (plus /landing, /pricing, /section, /entry) | Marketing pages and sections |
| layouts/auth-settings | Auth split, settings and wizard layouts |
| layouts/content | ContentLayout for direct use (content as children, host TOC entries, TOC levels, preserved heading ids) and the TOC helpers |
| layouts/content/{blog,docs,editorial} | Content page layouts |
| layouts/mobile | Mobile tabs and drawer layouts (registered for the layout host), their navigation model helpers, and the standalone BottomNav, MobileHeader and MobileAppFrame parts |
| layouts/host (plus /chrome, /drawer) | LayoutHost: lazy layout resolution with responsive fallbacks, shared chrome and a data-only nav model |
The layouts/{mobile,dashboard,marketing,auth-settings}/register subpaths
register a layout family with the host without pulling its components into
the initial chunk.
Helpers
texuli/cx exports cx (class composition) and variants (typed variant
recipes), so you can extend components without clsx or tailwind-merge.
It also exports composeHandlers and chainHandlers (also from texuli),
the "caller first" handler order every component follows, for parts you
build yourself: composeHandlers(callerHandler, own) runs the caller's
handler, then own unless the caller called event.preventDefault();
chainHandlers(callerHandler, own) always runs own (focus tracking, drag
state). A callerHandler that is not a function is ignored.
texuli/motion holds the motion prop contract and MotionProvider (new in
0.6.0): overlays, toasts, tabs, accordions and the
@texuli/data Board and DataGrid animate through @texuli/core/motion,
instant under reduced motion and at level none
(ui-motion.md).
texuli/motion/loop (new in 0.14.0) holds MotionLoop, a looping motion
(pulse, wave) on the motion tokens, static at rest under reduced motion
and at level none, so an app needs no @keyframes of its own.
texuli/defaults (new in 0.9.0) holds
setDesignDefaults: default variant and size props from a closed,
typed vocabulary, used only when a prop is omitted. Every component also
reads its component tokens (--tx-button-radius, --tx-card-padding-inline…)
and the tier-3 hooks (data-tx-button-style and friends)
(design-system.md).
texuli/design-system (from 0.10.0) adds DesignSystemProvider, a
scope element that applies a compiled design system and its component
defaults (design-system.md).
New in 0.8.0
Ships in 0.8.0; the 0.7.0 release predates it: component labels resolve through the
@texuli/core/i18n message catalog (ADR-016). setI18nContext(i18n) puts
a catalog in context, useMessages() is the lookup components read, and
TEXULI_MESSAGES_EN lists every label id with its English default; label
props keep winning, and English is the default (opt-in Spanish catalogs
from 0.14.3; other translations are planned)
(i18n).
Labels and locale
One label dictionary translates every built-in string of texuli,
@texuli/primitives, @texuli/blocks and @texuli/pages at once:
<LabelsProvider labels={es} locale="es"> from texuli/i18n near the root, or
setTexuliLabels(es, { locale: 'es' }) in a component's script (ADR-026;
new in 0.13.0).
A component's own label prop still wins
(i18n).
From 0.14.3, opt-in Spanish catalogs cover every id: TEXULI_LABELS_ES
(texuli/i18n/es, with the primitives), BLOCKS_LABELS_ES and
PAGES_LABELS_ES; they have had no native-speaker review yet
(Spanish catalogs).
New in 0.6.0
Ships in 0.6.0; the 0.5.0 release predates it. Under 0.x the new minor
may break; the breaking items are marked.
- One API contract:
bind:refand rest attributes on every exported component (menus, combobox, select, popover, navigation, pagination, sheet parts, command, number field, pin input,Radio,Tooltip,Calendar, the date controls,TagsInput,ColorPicker,Toggleand more), the Component API contract checked bytests/contract.test.ts. Layouts are not under the contract yet (planned). - Motion:
texuli/motion(MotionProvider, themotionprop): dialogs, sheets, popovers, hover cards, menus, tooltips, toasts, tabs and accordions animate through@texuli/core/motion(ui-motion). Breaking: the toast and tooltip CSS keyframes are gone, and a closing overlay stays mounted,inert, until its exit ends. - Breaking, Field ids:
FileUpload'sid(orinputId) reaches the file input andTagsInput's its text input (G56, G60); the date controls takehideLabel, hide their own label inside aField, and putidon their first segment (G63). - Breaking,
InputGroup:id,aria-*,data-*and handlers reach the input (ui-input). - Breaking,
avatar:data-avatarisinitialsafter an image error (G58). dialog,command:mode,container,onDismissRequestandonCloseAutoFocusonDialog,AlertDialogandCommandPalette(G53).tabs-accordion: the tab badge is part of the name, orbadgeLabel(G54).toast:action.retryOnErroranderrorText(G57); theToasterhas no top-layer viewport while empty, andmode="contained"with acontainer(G77).tags-color:TagsInputreadonlyand a list or RegExpdelimiter(G60, G61).card:CardGridgapvalues, and a callerstylekeeps the column template (G62).date:CalendardefaultFocusedValue,bind:focusedValueandonFocusedValueChange(G64);DateRangePickerrequiredandonInvalid(text, reason, { side })(G66).layouts/content: active-heading tracking witharia-current="location",activeIdandonActiveHeadingChange(G52).layouts/mobile: no wrapper for an emptystickyFooter(G68).layouts/marketingandlayouts/marketing/section:MarketingSectionHeader, a heading-only section header with no landmark or padding (G84).Tooltipbind:ref(the tooltip element,nullwhile hidden).
New in 0.5.0
Ships in 0.5.0; the 0.4.0 release predates it. Under 0.x the new minor
may break; the breaking items are marked.
- Breaking,
input: withtype="number"ortype="range",bind:valuebinds a number, ornullwhile empty;type="file"bindsfilesasnulluntil a pick. A calleroninputnow composes with the internal handler instead of replacing it (it used to stopbind:value) (ui-input). - Breaking,
toast: the store owns the auto-dismiss timers;onSettle(reason)(timeout,action,dismiss),pause,resume,isPausedandannouncement(ui-toast). - Breaking,
badge: theTagremove button is named after its tag ("Remove Design" by default;removeLabelcustomizes it) (ui-badge). - Breaking,
layouts/content:TocItem.levelandTocHeading.levelwiden from2 | 3to2 | 3 | 4 | 5 | 6(layouts-content). kbd-code:CopyButtontakesonCopyandonCopyError.date:today,weekStartsOn,maxDaysandonInvalidonCalendar,DatePickerandDateRangePicker, range highlight, and a styledTimeField(ui-date).- Overlays: a
stackoption onDialogandAlertDialog, focus-exempt regions (an undo toaster),ResponsiveModalforceand host sizing, and the sheetHeader,Body,FooterandCloseButtonparts (ui-dialog, ui-sheet). layouts/content(new subpath):ContentLayoutwith children, host TOC entries, TOC levels and preserved heading ids.layouts/mobile: standaloneBottomNav,MobileHeaderandMobileAppFrame(layouts-mobile).bind:refand rest attributes onDialog,Tabs,Accordion,Collapsible,TextCounter,Toolbar,ToggleGroupand more;ToggleGroupname;PinInput.Rootnameandbind:inputRef;CardGridmaxColumns; linkCardtarget,relanddownload;FileUploadonFilesAddandonFileRemove;Avatarsrcsetandsizesthrough the URL policy; a bindableTagsInputdraft; adestructivetone on menuItems; tab icons;PaginationstableCount; and the--tx-app-heightvariable documented forAppShell(layouts-shells).
Key guarantees
- Accessible by construction. Interactive components are built on primitives that follow the WAI-ARIA Authoring Practices patterns for roles, keyboard interaction and focus.
- Theming. Components are styled on the
--tx-*token contract, so any of the 210 library themes, or one you generate, restyles them in light and dark mode. - Your CSS wins. Component styles live in the
tx.componentscascade layer; unlayered or later-layer app CSS overrides them without!important. - Forced colors and right-to-left. Component stylesheets include forced-colors rules, and layouts use logical CSS properties.
- URL policy. Links and media (Button, Card, Breadcrumb, Sidebar and
others) pass the
@texuli/coreURL policy. App-authored props default to thedevelopertier; set theuntrustedtier (for examplehrefTrust="untrusted") for agent or user content. - No HTML sinks. Components render text and Svelte snippets, never
{@html}.
Documentation
- Website: texuli.com, the getting started guide, the component overview and the examples
- Every component and layout: packages/texuli/docs, for example ui-button.md and ui-dialog.md
- Using Texuli with your own CSS: using-with-your-css.md
- Class values and variants: class-value.md and variants-css.md
- Motion: ui-motion.md
- Component messages (i18n, new in 0.8.0): i18n.md
- Icons: ui-icons.md
- Layouts: layouts-shells.md, layouts-dashboard.md, layouts-content.md and layouts-mobile.md
Related packages
@texuli/tokens: the theme engine and design tokens these components read.@texuli/primitives: the headless primitives underneath.@texuli/core: framework-free behavior and URL policy.
Contributing
Source, issues and contribution guidelines live at github.com/DailybotHQ/texuli. Report bugs at github.com/DailybotHQ/texuli/issues.
License
MIT © Dailybot, Inc. Powered by Dailybot.
