Durusu UI
Clear-water components for Angular.
56 components on one theming engine. Give it a key colour and it makes every role, in light and dark, at a tone that keeps its contrast. Bright surfaces sit on a quiet page, lifted by a hairline and a shadow, and one number makes any region denser. This page runs that engine: pick a colour and everything on it follows.
Try another key colour
Theming
One key colour, every role
Components use roles, never palette stops. The engine takes one key colour and sets every role at a fixed tone for the mode, so the contrast below holds for any colour you choose.
Accents
Primary for what matters most, secondary for quieter elements, tertiary for a contrasting accent.
Status
The same in every theme, still adapting to light and dark. Always beside a word or icon.
Surfaces
Three grounds and two washes. Text holds its contrast on every one.
Content, borders and inverse
How the engine makes a theme
Start from one key colour
Primary is the only one a theme needs. Secondary is primary at 35% of its chroma; tertiary turns its hue 60 degrees at 70%, or further when that would land on a status colour. The neutrals keep the hue with almost no chroma.
Set each role at a tone
Tone is CIE L*, 0 to 100, measured from the same luminance WCAG uses. An accent's fill, label, container and label on the container sit at 40, 100, 90 and 10 in light, and at 80, 20, 30 and 90 in dark.
Take hue and chroma from the key colour
A palette lends each role the hue and chroma of its stop nearest the tone. A single brand colour keeps its perceived hue at every tone, so a blue never turns cyan as it lightens. The lightness is solved onto the tone inside sRGB, to within 0.02.
Check every pairing at build time
Contrast between two roles depends only on their tones, so it holds for any key colour, on any screen. The build checks text and edges on every ground and on each wash over it, and fails on a miss.
The tones
Light and dark are the same roles at different tones.
| Role | Light | Dark |
|---|---|---|
| Accent fill | 40 | 80 |
| Label on an accent | 100 | 20 |
| Accent container | 90 | 30 |
| Label on a container | 10 | 90 |
| background (the page) | 98 | 4 |
| surface | 100 | 8 |
| surface-overlay | 100 | 11 |
| surface-subtle | on-surface at 5% | on-surface at 6% |
| surface-strong | on-surface at 12% | on-surface at 14% |
| on-surface | 10 | 90 |
| on-surface-muted | 30 | 80 |
| border | 50 | 60 |
| border-subtle | 80 | 30 |
| surface-inverse | 20 | 90 |
Surfaces and elevation
A bright surface, a hairline and a shadow
Tone does not climb with height. The page is background, one step off white; everything on it is the bright surface, lifted by a border-subtle hairline and a shadow. Pop-ups take surface-overlay, a step brighter in dark where shadows barely read. Filled areas are translucent washes of the text colour, so they work on any ground.
Harbour survey
surface · border-subtle · shadow-1
The page. Tone 98 in light, 4 in dark.
Cards, panels, sidebars, fields, raised buttons, drawers. White in light, tone 8 in dark.
Menus, select and picker panels, popovers, toasts, dialogs. Equal to surface in light; tone 11 in dark, so a menu parts from the card under it.
on-surface at 5% (6% dark): filled fields and cards, header and zebra rows, skeletons, neutral badges.
on-surface at 12% (14% dark): slider, progress and scrollbar tracks, avatar fallbacks.
On anything sticky, lay a wash over an opaque surface so rows don't show through.
Size and density
One number, every component
Density is a whole number from 0 to −3. The theme emits nothing for 0 and one line for any other region. Each component moves its own heights and padding by a fixed step per level and stops at its own floor; by −3 every one has reached it. A size is where a control starts. Type, radius and the 20px marks never move.
data-density="0"| Station | Depth |
|---|---|
| North quay Live | 8.4 |
| Channel | 15.7 |
data-density="-2"| Station | Depth |
|---|---|
| North quay Live | 8.4 |
| Channel | 15.7 |
data-density="-3"| Station | Depth |
|---|---|
| North quay Live | 8.4 |
| Channel | 15.7 |
How far each thing moves
Bold amber: held at its floor.
| What | 0 | −1 | −2 | −3 | Step |
|---|---|---|---|---|---|
| Button, medium | 40px | 36px | 32px | 28px | 4px |
| Button, small | 32px | 28px | 24px | 24px | 4px |
| Button, large | 48px | 44px | 40px | 36px | 4px |
| Form field, tabs, table header | 40px | 36px | 32px | 28px | 4px |
| Toolbar | 56px | 52px | 48px | 44px | 4px |
| Option in a list, tree row | 36px | 32px | 28px | 28px | 4px |
| Table row, accordion header | 48px | 44px | 40px | 36px | 4px |
| Badge | 20px | 18px | 16px | 16px | 2px |
| Card padding | 24px | 20px | 16px | 12px | 4px |
| Alert padding | 16px | 12px | 8px | 8px | 4px |
| Gap between form rows | 24px | 20px | 16px | 12px | 4px |
Pop-ups stay at 0
The overlay container resets density, so a menu opened from a dense toolbar is still easy to read and hit. Menus, panels, popovers, tooltips, toasts and dialogs are exempt.
Targets never shrink
A control drawn below 24px keeps a 24px hit area, and 44px on coarse pointers. Text never shrinks either, so iOS Safari never zooms a dense form.
Overrides stay dense
The step goes in the component's own declaration, so a token override sets where it starts and density still moves it. Anything outside 0 to −3, such as Angular Material's −4 and −5, fails the build.
In Sass and markup
// the whole theme
@include durusu.theme((color: (primary: stone), typography: (), density: -2));
// one region: emits .data-grid { --durusu-sys-density: -3; }
@include durusu.theme((density: -3), '.data-grid');
// a component, on the element that draws it
height: dense(height, $tokens, button, control, 1.75rem);
// or in markup
<section data-density="-2">…</section>Components
56 components in seven groups
Each one comes from the same six decisions, in order: size, shape, surface, content, state, and elevation and motion. The previews read the system's tokens, so they follow the key colour, mode and density you set above.
Opt-in. The wave replaces the press layer.
Inline, so its options move with density. The same option in a pop-up panel stays at 36px.
Raised
Surface, hairline and shadow-1. On the page.
Outlined
Surface and hairline. Where a shadow is noise.
Filled
A surface-subtle wash, inside another surface.
Everyone in the workspace. Private projects show only to their members.
Delete project?
Harbour survey and its 214 soundings will be removed for everyone.
Filters
Anyone in the workspace with the link can view.
| Station | Status | Depth (m) | Readings | Lead | |
|---|---|---|---|---|---|
| North quay | Live | 8.4 | 214 | AW | |
| Breakwater | Drifting | 12.1 | 96 | JK | |
| Channel | Live | 15.7 | 388 | AW | |
| Outer buoy | Offline | 22.3 | 41 | KO |
A 24px grid, a 2px stroke, round caps and joins, in the colour of the text.
All 56, by group
Each one is its own entry point, so an app loads only what it imports.
Actions 5
- button
- Starts an action. One component covers the text button, the icon button and the FAB.
- toggle-button
- A button that stays on. Alone it toggles one setting; in a group it picks one or several of a few options.
- dropdown
- The menu: a list of actions that opens from a trigger.
- toolbar
- A bar that groups a title and the actions that belong to one surface.
- ripple
- A directive that draws a wave from the point of contact, for hosts that opt in to a stronger press.
Form controls 17
- form-field
- The wrapper that draws the box, label and message for every text-like control.
- input
- The native text input and textarea. It has no styling of its own; the form field draws it.
- checkbox
- Turns one option on or off, or picks several from a list.
- radio
- Picks exactly one of a short list.
- toggle-switch
- Turns a setting on or off with immediate effect.
- slider
- Picks a number, or a range, by dragging along a track.
- knob
- A rotary control for a bounded number, where a slider has no room.
- rating
- Captures or shows a score out of a small number of stars.
- select
- Picks one value, or several, from a closed list.
- combobox
- A select you can type in: filters a closed list as you type.
- autocomplete
- A text input that offers suggestions. The value is whatever is typed.
- listbox
- A list of options that is always visible, for one or several choices.
- option
- One row in a select, combobox, autocomplete or listbox. Shared by all four.
- chips
- Compact pills that filter, choose, or hold the entries of a multi-value field.
- datepicker
- Picks a date or a date range from a calendar, or by typing.
- timepicker
- Picks a time of day from columns of hours and minutes, or by typing.
- picklist
- Moves items between an available list and a chosen list, and orders the chosen ones.
Navigation 6
- tabs
- Switches between views of the same subject.
- breadcrumb
- Shows where the page sits in a hierarchy and links back up it.
- paginator
- Moves through pages of a long list or table.
- stepper
- Shows progress through a fixed sequence of steps and lets people move between them.
- scrollspy
- A list of in-page links that marks the section currently in view.
- treeview
- Shows a hierarchy that can be expanded, navigated and selected.
Layout and containers 10
- card
- A static surface that groups related content.
- accordion
- A stack of headers that each reveal a panel.
- collapsible
- The headless primitive that shows and hides one region.
- divider
- A hairline that separates content.
- grid-list
- Lays out tiles of equal weight in a responsive grid.
- splitter
- Divides an area into panes that can be resized by dragging the gutter between them.
- scroll-area
- A scroll container with thin, themed scrollbars.
- virtual-list
- Renders only the visible rows of a very long list.
- carousel
- Shows a row of slides one view at a time.
- timeline
- Shows events in order along a line.
Overlays 5
- dialog
- A modal surface that asks for a decision or a short task.
- drawer
- A panel that slides in from an edge, as an overlay or pushing the content beside it.
- popover
- A small non-modal surface anchored to a trigger, for content richer than a tooltip.
- tooltip
- A short text label that appears on hover or focus.
- toast
- A brief message about something that just happened, shown at the edge of the screen.
Feedback and status 9
- alert
- A message in the page about the state of a task or a section.
- badge
- A small label for status, category or count.
- progress-bar
- Shows how far a task has got, or that it is running.
- progress-spinner
- A circular indicator that something is loading or progressing.
- skeleton
- A placeholder in the shape of content that is loading.
- meter
- Shows a measurement within a known range: storage used, password strength, a score.
- meter-group
- One bar split into segments that add up to a whole.
- radial-meter
- A meter drawn as a ring, for a single headline percentage.
- gauge
- A half-ring that shows where a reading sits on a scale, optionally against coloured bands.
Data display 4
- table
- Rows and columns of data that can be sorted, selected and paged.
- chart
- The shared look for charts: series colours, axes, grid, legend and tooltip.
- avatar
- Represents a person or a team with an image, initials or an icon.
- icon
- Renders one glyph from the icon set at a text-relative or fixed size.
Foundations
Type, shape, depth and motion
Figtree sets every category, Roboto Mono sets code, and every line box is a whole step. Fifteen styles cover the whole interface, and none of them changes with density.
display-largeClear water96/104 · 700display-mediumClear water72/80 · 700display-small214 soundings60/68 · 600headline-largeHarbour survey48/56 · 600headline-mediumHarbour survey36/44 · 600headline-smallHarbour survey30/38 · 600title-largeInvite your team24/32 · 600title-mediumInvite your team20/28 · 600title-smallInvite your team18/26 · 500body-largeChanges are saved as you type and synced to every device.18/28 · 400body-mediumChanges are saved as you type and synced to every device.16/24 · 400body-smallChanges are saved as you type and synced to every device.14/20 · 400label-largeSave changes16/24 · 500label-mediumSave changes14/20 · 500label-smallSave changes12/16 · 500Shape
Radius follows size: small parts take small radii, surfaces take large ones. A medium button keeps radius-lg however dense it gets.
xs2pxsm4pxmd6pxlg8pxxl12px2xl16px3xl24px4xl32pxfullpillElevation
Two shadows each, contact then ambient, on black, 1.5 times stronger in dark. Every lifted surface also carries the hairline.
Motion
Seven easings. Enter decelerates, exit accelerates; nothing that answers a click runs past 400ms.
easing-moveChanges place or sizeeasing-enterSmall overlays ineasing-exitSmall overlays outeasing-enter-emphasizedDialogs, drawers ineasing-exit-emphasizedDialogs, drawers outeasing-overshootTicks, thumbs, 48px or lesseasing-linearFades and loopsStates
A layer of the content colour over the fill. Selected and current are a primary tint. Focus is a 2px primary ring at a 2px offset.
00.080.120.160.160.080.1212% fill · 38% textGet started
Three steps to a themed app
1 · Install
pnpm add @durusu/ui @durusu/theming @angular/cdk2 · Theme
// styles.scss
@use '@durusu/ui' as durusu;
html {
@include durusu.theme((
color: (primary: stone),
typography: (),
));
}
// a denser region
@include durusu.theme((density: -2), '.admin');3 · Use
import { DurusuButton } from '@durusu/ui/button';
<!-- in the template -->
<button durusuButton="filled">Save</button>
<button durusuButton="outlined">Cancel</button>Questions
Frequently asked
Can I use my own brand colour?
Yes. Give the theme any colour, a palette name or a tonal map as primary. The engine places every role at its tone and checks the contrast at build time, so a brand colour can't produce unreadable text.
How does dark mode work?
The default theme is adaptive: each role is a light-dark() pair that follows the system. Set data-color-scheme="light" or "dark" on any element to pin it, or build a fixed theme with theme-mode.
Why surfaces instead of Material's container tones?
Elevation here is shown the way most current interfaces show it: a bright surface on a slightly darker page, with a hairline and a shadow. So there are three grounds, background, surface and surface-overlay, and a shadow scale for depth.
Can one part of the page be denser?
Yes. Put data-density="-2" on any element, or include the theme with a selector and a density. Each component reads the one inherited number; pop-ups opened from that region stay at 0.
Why does density stop at −3 when Material goes to −5?
Durusu's defaults start smaller (a 40px field rather than 56px), so every component reaches its floor by −3. A config written for Material that says −4 or −5 fails the build, with a message telling you to use −3.
Does it work without Angular?
Yes. The theming engine is its own package, @durusu/theming: plain Sass that emits CSS custom properties, with ten prebuilt themes as plain CSS. @durusu/theming/tailwindcss maps the same tokens into Tailwind CSS v4, so bg-primary or rounded-lg follow the theme. The components are Angular, and @durusu/ui forwards the engine, so an Angular app needs one import.