ray·elements · components

Components

79 web components for any app: a live example, its code in HTML, React and Vue, and its API generated from its component.toml.

Buttons

5

Actions, on their own or grouped, with an icon or a pressed state.

Inputs

22

Form fields that take part in a <form>: name, value, validation.

Avatar picker (Profile picture, Photo picker)A profile picture field: a ray-avatar (the initials of display-name without a picture), Choose photo / Change photo and Remove photo, and a sheet with a ray-image-crop to frame the chosen image in a circle before it is kept.<ray-avatar-picker> CheckboxA checkbox with label, description and error.<ray-checkbox> Checkbox groupSeveral choices among options (Mantine's Checkbox.Group): a label, description and error around ray-checkbox elements; the value is the array of the checked ones.<ray-checkbox-group> Color pickerPick a color: an inline picker (saturation area, hue, opacity, swatches) and a text field with the picker in a dropdown and an eyedropper.<ray-color-picker> <ray-color-input> Combobox (Multi select)A select you can type in, an autocomplete (Mantine's searchable Select and MultiSelect; for free-form tags, ray-tags-input): typing filters the options; multiple keeps chips; creatable adds new values; clearable, max-values, groups, a result limit.<ray-combobox> Date pickerA date field with a calendar dropdown, and the calendar on its own.<ray-date-picker> <ray-calendar> File uploadA drop zone to pick files: drag, click, keyboard or paste.<ray-file-upload> Image cropFrame an image in a rectangle or a circle of a fixed aspect, by dragging, pinching, the wheel or the keyboard, and export the framed part at a chosen size as a Blob or a data URL.<ray-image-crop> InputA text field with label, description and error (Mantine's TextInput).<ray-input> Knob (Rotary, Dial, Potentiometer)A rotary control (a mixer's gain or pan, an effect's amount): drag up or down, the wheel or the arrow keys turn it, a double click puts it back; a log scale for frequencies, a bipolar arc for pan.<ray-knob> Mode inputA text field with a menu of modes on one side: choosing a mode applies its attributes to the field (type, placeholder, inputmode, pattern…), so one control says what a value is and the value — a file path or text, an amount in € or $, a search by name or ID.<ray-mode-input> Number inputA number field (Mantine's NumberInput): + and − buttons (hold to repeat), arrow keys, min, max and step, fixed decimals, a prefix and a suffix, a thousands separator, or a duration (m:ss).<ray-number-input> Password inputA password field with a button that shows or hides what was typed (Mantine's PasswordInput).<ray-password-input> Path input (File path, Folder picker)A field for a path on disk: a file to open, a folder, or where to save.<ray-path-input> Radio groupOne choice among options: ray-radio (or ray-radio-card) elements inside a ray-radio-group, which is the form control.<ray-radio-group> <ray-radio> <ray-radio-card> SearchA search box: icon, clear button, an optional shortcut that focuses it, and a debounced ray-search event.<ray-search> Segmented controlOne choice among a few, as a segmented row with a sliding indicator.<ray-segmented-control> SelectA select with its own dropdown (keyboard, typeahead, groups); options from child <option> elements or the data property.<ray-select> Slider (Range, Fader)A native range input (keyboard, touch and screen readers as usual) with label, value display and marks; horizontal or vertical (a fader), with a round thumb or a mixing desk's cap (and a fader's gestures), linear or on a fader's dB curve.<ray-slider> SwitchAn on/off toggle with the same API as Checkbox, announced as a switch.<ray-switch> Tags input (Tag input, Chips input, TagsInput)Free-form tags with the suggestions in view (Mantine's TagsInput; to pick from a fixed list, ray-combobox): what is typed becomes a tag on Enter, a comma or leaving the field; the suggestions are buttons under the field, filtered as you type, one click adds one.<ray-tags-input> TextareaA multi-line text field that can grow with its content.<ray-textarea>
8

Moving around an app: links, tabs, pages, the side bar.

Overlays

6

Above the page: modals, drawers, menus, popovers, the command palette.

Data display

15

Content and data: tables, stats, code, media, badges.

AccordionCollapsible sections (WAI-ARIA accordion pattern); one open at a time, or several with multiple.<ray-accordion> <ray-accordion-item> AttachmentA file in a composer, upload list or chat: thumbnail or type icon, name, size, upload progress, error, remove and download.<ray-attachment> <ray-attachments> AvatarAn image, the initials of a name, or a placeholder icon.<ray-avatar> BadgeA short status label.<ray-badge> BlockquoteA quotation set apart from the text (Mantine's Blockquote): a colored edge, a quote mark on it and the attribution below.<ray-blockquote> CarouselSlides in a scroll-snap viewport: native swipe and scrolling, previous/next controls, indicators, keyboard, loop and autoplay with a pause button.<ray-carousel> CodeA block of source code: header with file name and language, copy button, line numbers, highlighted lines, diff lines, wrapping and a "show more" height.<ray-code> IconAn icon of the registry: the whole set (the components' too) changes with setIcons().<ray-icon> IndicatorA dot or a small label on the edge of any element (Mantine's Indicator): "New" on an avatar, an unread count on a bell, an online dot.<ray-indicator> KbdA keyboard key: a raised keycap, or a flat chip (filled or outline) for hints in menus and buttons.<ray-kbd> Meter (Level meter, VU meter, Peak meter)An audio level meter (a mixer's channel strip): peak and RMS in dB, green, yellow and red zones, a peak hold line and a clip mark, one bar per channel; setLevels() on every animation frame costs no render.<ray-meter> QR code (QR, Barcode, 2D code)A QR code of a text or a link (to open on a phone, pair a device, set up two-step sign-in), drawn as one SVG path: sharp at any size and in print.<ray-qr> StatA metric tile: label, value, change against a previous period, note.<ray-stat> TableA data table from columns and data: sorting (aria-sort), row selection, clickable rows, sticky header, striped, empty state.<ray-table> TimelineEvents in order along a line (Mantine's Timeline): activity, history, a deploy's stages.<ray-timeline> <ray-timeline-item>

Feedback

9

What the app says back: alerts, notifications, progress, loading.

Layout

13

The frame of an app and of its content: the shell and its bars, stacks, groups, grids, cards, scrolling.

App barThe top bar of a phone screen (Material's top app bar, the iOS navigation bar): back or menu, a title and subtitle, actions, and an optional row under it.<ray-app-bar> App shellThe frame of an app (Mantine's AppShell): header, navbar, main, aside and footer on wide screens; on phones one column with a bottom bar.<ray-app-shell> Aspect ratioA box with a fixed width/height ratio; its image, video or iframe fills it.<ray-aspect-ratio> CardA surface for grouped content, with optional media, header and footer.<ray-card> CenterIts content centered on both axes (Mantine's Center): empty states, loaders, a sign-in card.<ray-center> ContainerIts content centered, up to a maximum width, with side padding (Mantine's Container): the column of a page.<ray-container> GridA responsive grid: a column count per width (cols="1 sm:2 lg:4") measured on the grid itself, or as many columns of a minimum width as fit.<ray-grid> GroupIts children in a row (Mantine's Group): spaced by the space scale, centered, wrapping when they do not fit.<ray-group> Scroll areaA box that scrolls its content with the native scrolling and a thin themed scrollbar (Mantine's ScrollArea).<ray-scroll-area> SeparatorA horizontal or vertical rule, optionally labeled (Mantine's Divider).<ray-separator> SplitTwo panes with a draggable, keyboard-accessible divider (window splitter pattern); one pane has the size (the start one, or the end one with fixed="end": a docked inspector), which can be remembered.<ray-split> StackIts children in a column, spaced by the space scale (Mantine's Stack): forms, panels, anything stacked.<ray-stack> Status barThe bar at the bottom of an app window: items on the left and on the right; items with action are buttons.<ray-statusbar> <ray-statusbar-item>

Theme

1

Light, dark or the system's choice.