WaterLevel
A vessel that fills with water. Two waves drift past each other, the surface sloshes when the level changes, the percentage flips to a light ink as the water passes behind it, and the water turns amber when it runs low. Data.
Open playground62 of 200 L
About
WaterLevel is a React component in the Data category of smoui. It is typed, ships no stylesheet, follows your theme through CSS variables, and honors prefers-reduced-motion. Import it with import { WaterLevel } from "@ashutoshswamy/smoui" and set value, max, shape among its 7 props.
Install
npm i @ashutoshswamy/smouiUsage
import { WaterLevel } from "@ashutoshswamy/smoui";
<WaterLevel value={62} max={200} unit="L" low={0.2} label="Rainwater tank" />
<WaterLevel value={62} max={200} shape="circle" size={120} />Props 7
- value
Current amount, 0 to max.
number- max
The full amount.
numberdefault100- shape
Rounded tank or round flask.
"tank""circle"default"tank"- size
Width in px. A tank is 1.3 times as tall.
numberdefault150- unit
Adds an "x of y unit" line under the vessel.
string- low
Share of full (0 to 1) below which the water turns amber.
number- label
Accessible name.
stringdefault"Water level"
More data components
- ActivityFeedA feed joined by a thin line. New items slide in at the top while the rest make room; the first load rises in item by item.
- CalendarMonth grid date picker. The month slides the way you travel, the selection glides between days and across months, and arrows, Home, End and Page keys all work.
- DataTableA data table on one flat surface. Search, sort, page and select; rows glide into their new order, one highlight stretches between rows, a selection bar takes over the toolbar, and rows open to detail. People, status and number columns are built in.
- DiffViewA line diff. Changed lines slide in from their side, the part that really changed is marked, and a thumb switches between one column and two.
- FilterListTag chips with live counts above a list. Pick chips and the list narrows: what stays glides up, what goes fades out.
- KanbanA board whose columns wrap to any width. Cards carry tags, priority, a due date and people. Pick one up and it lifts and tilts, a slot opens where it will land and the rest slide apart. Work-in-progress limits, inline add and keyboard moves are built in.