← All @molecule/* packages · App templates
@molecule/app-ui-angularFramework · ui · App (browser) · v1.0.1 · Apache-2.0
Angular UI components for molecule.dev
npm install @molecule/app-ui-angularnpm · Source on GitHub · Implements @molecule/app-ui
@molecule/app-ui-angular adapts the @molecule/* cores to the ui framework on the app (browser) side.
import { Component } from '@angular/core'
import { setClassMap } from '@molecule/app-ui'
import { classMap } from '@molecule/app-ui-tailwind'
import { MoleculeButton, MoleculeInput } from '@molecule/app-ui-angular'
// Once at startup, before the first component renders:
setClassMap(classMap)
@Component({
selector: 'app-save-panel',
standalone: true,
imports: [MoleculeButton, MoleculeInput],
template: `
<mol-input placeholder="Name" [value]="name" (handleInput)="onName($event)"></mol-input>
<mol-button color="primary" [loading]="saving" (handleClick)="save()">Save</mol-button>
`,
})
class SavePanel {
name = ''
saving = false
onName(event: Event): void {
this.name = (event.target as HTMLInputElement).value
}
save(): void {}
}Works with: @molecule/app-i18n, @molecule/app-icons, @molecule/app-ui
Auto-generated, AI-first package reference for the molecule.dev ecosystem. It is written to be read by coding agents as much as by people, and is generated from this package's source — edit
src/index.tsJSDoc, not this file.
Angular UI components for molecule.dev.
Provides standalone Angular components implementing a SUBSET of the
@molecule/app-ui component interfaces, styled through the UIClassMap
abstraction. Ships 12 components — MoleculeAlert, MoleculeBadge,
MoleculeButton, MoleculeCheckbox, MoleculeInput, MoleculeModal,
MoleculeRadioGroup, MoleculeSelect, MoleculeSpinner,
MoleculeSwitch, MoleculeToast, MoleculeTooltip — each a standalone
component with a mol-* selector. Layout/data components (Card, Table,
Tabs, Accordion, Dropdown, Icon, …) are not implemented for Angular yet;
compose them from ClassMap classes via getClassMap().
import { Component } from '@angular/core'
import { setClassMap } from '@molecule/app-ui'
import { classMap } from '@molecule/app-ui-tailwind'
import { MoleculeButton, MoleculeInput } from '@molecule/app-ui-angular'
// Once at startup, before the first component renders:
setClassMap(classMap)
@Component({
selector: 'app-save-panel',
standalone: true,
imports: [MoleculeButton, MoleculeInput],
template: `
<mol-input placeholder="Name" [value]="name" (handleInput)="onName($event)"></mol-input>
<mol-button color="primary" [loading]="saving" (handleClick)="save()">Save</mol-button>
`,
})
class SavePanel {
name = ''
saving = false
onName(event: Event): void {
this.name = (event.target as HTMLInputElement).value
}
save(): void {}
}
framework
npm install @molecule/app-ui-angular @angular/core @angular/platform-browser @molecule/app-i18n @molecule/app-icons @molecule/app-ui
AccordionItemA single item in an Accordion component.
interface AccordionItem<T = string> {
/**
* Item value/id.
*/
value: T
/**
* Item header/trigger.
*/
header: Children
/**
* Item content.
*/
content: Children
/**
* Whether the item is disabled.
*/
disabled?: boolean
}
AccordionPropsProps for the Accordion component.
interface AccordionProps<T = string> extends BaseProps {
/**
* Accordion items.
*/
items: AccordionItem<T>[]
/**
* Expanded item(s).
*/
value?: T | T[]
/**
* Default expanded item(s).
*/
defaultValue?: T | T[]
/**
* Change handler.
*/
onChange?: (value: T | T[]) => void
/**
* Whether multiple items can be expanded.
*/
multiple?: boolean
/**
* Whether items can be collapsed.
*/
collapsible?: boolean
}
AlertPropsProps for the Alert component.
interface AlertProps extends HTMLElementProps {
/**
* Alert content.
*/
children?: Children
/**
* Alert title.
*/
title?: string
/**
* Alert status/type.
*/
status?: ColorVariant
/**
* Alert variant.
*/
variant?: 'solid' | 'subtle' | 'outline' | 'left-accent'
/**
* Whether the alert is dismissible.
*/
dismissible?: boolean
/**
* Called when dismissed.
*/
onDismiss?: () => void
/**
* Icon to display.
*/
icon?: Children
/**
* Accessible label for the dismiss button.
* @default 'Dismiss'
*/
dismissLabel?: string
}
AvatarPropsProps for the Avatar component.
interface AvatarProps extends HTMLElementProps {
/**
* Image source URL.
*/
src?: string
/**
* Alt text for the image.
*/
alt?: string
/**
* Name for fallback initials.
*/
name?: string
/**
* Avatar size.
*/
size?: Size | number
/**
* Whether the avatar is rounded.
*/
rounded?: boolean
/**
* Fallback element when no image.
*/
fallback?: Children
}
BadgePropsProps for the Badge component (status labels, counts, tags).
interface BadgeProps extends HTMLElementProps {
/**
* Badge content.
*/
children?: Children
/**
* Badge color.
*/
color?: ColorVariant
/**
* Badge variant.
*/
variant?: 'solid' | 'outline' | 'subtle'
/**
* Badge size.
*/
size?: Size
/**
* Whether the badge is rounded.
*/
rounded?: boolean
}
BasePropsBase props shared by all components.
interface BaseProps {
/**
* Additional CSS class name(s).
*/
className?: string
/**
* Inline styles.
*/
style?: CSSProperties
/**
* Test ID for automated testing.
*/
testId?: string
/**
* Automation ID for AI agents and E2E tests. Maps to the `data-mol-id`
* HTML attribute. Use `molId()` from `./automation.js` to generate
* semantic IDs. (Tooling only — screen readers do not expose `data-*`
* attributes; accessible names come from labels/`aria-*`.)
*/
automationId?: string
/**
* Whether the component is disabled.
*/
disabled?: boolean
}
ButtonElementPropsBase props for button elements.
interface ButtonElementProps extends HTMLElementProps {
type?: 'button' | 'submit' | 'reset'
name?: string
value?: string
form?: string
}
ButtonPropsProps for the Button component.
interface ButtonProps extends ButtonElementProps {
/**
* Button content.
*/
children?: Children
/**
* Visual variant.
*/
variant?: ButtonVariant
/**
* Color scheme.
*/
color?: ColorVariant
/**
* Button size.
*/
size?: ButtonSize
/**
* Whether the button is in a loading state.
*/
loading?: boolean
/**
* Loading text to display.
*/
loadingText?: string
/**
* Whether the button takes full width.
*/
fullWidth?: boolean
/**
* Icon to display before the label.
*/
leftIcon?: Children
/**
* Icon to display after the label.
*/
rightIcon?: Children
}
CardPropsProps for the Card container component (elevated, outlined, or filled surface).
interface CardProps extends HTMLElementProps {
/**
* Card content.
*/
children?: Children
/**
* Card variant.
*/
variant?: 'elevated' | 'outlined' | 'filled'
/**
* Whether the card is interactive (clickable).
*/
interactive?: boolean
/**
* Padding size.
*/
padding?: Size | 'none'
}
CheckboxPropsProps for the Checkbox component.
interface CheckboxProps extends InputElementProps {
/**
* Checkbox label.
*/
label?: Children
/**
* Whether the checkbox is checked.
*/
checked?: boolean
/**
* Whether the checkbox is in an indeterminate state.
*/
indeterminate?: boolean
/**
* Checkbox size.
*/
size?: Size
/**
* Error message.
*/
error?: string
}
ContainerPropsProps for the Container layout component.
interface ContainerProps extends HTMLElementProps {
/**
* Container content.
*/
children?: Children
/**
* Maximum width.
*/
maxWidth?: 'sm' | 'md' | 'lg' | 'xl' | '2xl' | 'full' | string
/**
* Whether to center the container.
*/
centered?: boolean
/**
* Horizontal padding.
*/
paddingX?: Size | string
}
CSSPropertiesFramework-agnostic CSS properties. Mirrors React.CSSProperties but without React dependency.
interface CSSProperties {
[key: string]: string | number | undefined
}
FlexPropsFlex container props.
interface FlexProps extends HTMLElementProps {
/**
* Flex content.
*/
children?: Children
/**
* Flex direction.
*/
direction?: 'row' | 'column' | 'row-reverse' | 'column-reverse'
/**
* Justify content.
*/
justify?: 'start' | 'end' | 'center' | 'between' | 'around' | 'evenly'
/**
* Align items.
*/
align?: 'start' | 'end' | 'center' | 'baseline' | 'stretch'
/**
* Flex wrap.
*/
wrap?: 'wrap' | 'nowrap' | 'wrap-reverse'
/**
* Gap between items.
*/
gap?: Size | string | number
}
FormElementPropsBase props for form elements.
interface FormElementProps extends HTMLElementProps {
action?: string
method?: 'get' | 'post'
encType?: string
target?: string
noValidate?: boolean
autoComplete?: 'on' | 'off'
onSubmit?: FormEventHandler
onReset?: FormEventHandler
}
FormFieldPropsForm field wrapper props.
interface FormFieldProps extends HTMLElementProps {
/**
* Field content.
*/
children?: Children
/**
* Field label.
*/
label?: string
/**
* Field name.
*/
name?: string
/**
* Error message.
*/
error?: string
/**
* Hint/help text.
*/
hint?: string
/**
* Whether the field is required.
*/
required?: boolean
}
FormPropsProps for the Form component (wraps inputs with submission handling and validation).
interface FormProps extends FormElementProps {
/**
* Form content.
*/
children?: Children
/**
* Submit handler with form data.
*/
onFormSubmit?: (data: Record<string, unknown>) => void | Promise<void>
/**
* Whether the form is submitting.
*/
submitting?: boolean
}
GridPropsGrid container props.
interface GridProps extends HTMLElementProps {
/**
* Grid content.
*/
children?: Children
/**
* Number of columns.
*/
columns?: number | string
/**
* Number of rows.
*/
rows?: number | string
/**
* Gap between items.
*/
gap?: Size | string | number
/**
* Column gap.
*/
columnGap?: Size | string | number
/**
* Row gap.
*/
rowGap?: Size | string | number
}
HTMLElementPropsBase props for HTML elements. Framework bindings should extend this with framework-specific attributes.
interface HTMLElementProps extends BaseProps {
id?: string
title?: string
tabIndex?: number
role?: string
'aria-label'?: string
'aria-labelledby'?: string
'aria-describedby'?: string
'aria-hidden'?: boolean
'aria-disabled'?: boolean
'aria-expanded'?: boolean
'aria-selected'?: boolean
'aria-checked'?: boolean | 'mixed'
'aria-pressed'?: boolean | 'mixed'
'aria-invalid'?: boolean
'aria-required'?: boolean
'aria-readonly'?: boolean
'aria-busy'?: boolean
'aria-live'?: 'off' | 'polite' | 'assertive'
onClick?: MouseEventHandler
onDoubleClick?: MouseEventHandler
onMouseEnter?: MouseEventHandler
onMouseLeave?: MouseEventHandler
onFocus?: FocusEventHandler
onBlur?: FocusEventHandler
onKeyDown?: KeyboardEventHandler
onKeyUp?: KeyboardEventHandler
onKeyPress?: KeyboardEventHandler
}
InputElementPropsBase props for input elements.
interface InputElementProps extends HTMLElementProps {
name?: string
value?: string | number | readonly string[]
defaultValue?: string | number | readonly string[]
placeholder?: string
required?: boolean
readOnly?: boolean
autoFocus?: boolean
autoComplete?: string
maxLength?: number
minLength?: number
pattern?: string
onChange?: ChangeEventHandler
onInput?: FormEventHandler
}
InputPropsProps for the Input component (text field, email, password, etc.).
interface InputProps extends InputElementProps {
/**
* Input type.
*/
type?: InputType
/**
* Input size.
*/
size?: Size
/**
* Horizontal text alignment inside the input (see
* {@link InputClassOptions.align}). Defaults to the bond's own style.
*/
align?: 'left' | 'center'
/**
* Label text.
*/
label?: string
/**
* Error message.
*/
error?: string
/**
* Hint/help text.
*/
hint?: string
/**
* Element to display on the left.
*/
leftElement?: Children
/**
* Element to display on the right.
*/
rightElement?: Children
/**
* Whether to show a clear button.
*/
clearable?: boolean
/**
* Called when the clear button is clicked.
*/
onClear?: () => void
/**
* Accessible label for the clear button.
* @default 'Clear'
*/
clearLabel?: string
}
ModalPropsProps for the Modal/Dialog component.
interface ModalProps extends HTMLElementProps {
/**
* Whether the modal is open.
*/
open: boolean
/**
* Called when the modal should close.
*/
onClose: () => void
/**
* Modal title.
*/
title?: string
/**
* Modal content.
*/
children?: Children
/**
* Modal size.
*/
size?: ModalSize
/**
* Whether to show a close button.
*/
showCloseButton?: boolean
/**
* Whether clicking the overlay closes the modal.
*/
closeOnOverlayClick?: boolean
/**
* Whether pressing Escape closes the modal.
*/
closeOnEscape?: boolean
/**
* Footer content (typically action buttons).
*/
footer?: Children
/**
* Whether the modal is centered vertically.
*/
centered?: boolean
/**
* Whether to prevent body scroll when open.
*/
preventScroll?: boolean
/**
* Accessible label for the close button.
* @default 'Close'
*/
closeLabel?: string
}
PaginationPropsProps for the Pagination component (page navigation with current page, total, page size, and change callbacks).
interface PaginationProps extends BaseProps {
/**
* Current page (1-indexed).
*/
page: number
/**
* Total number of pages.
*/
totalPages: number
/**
* Page change handler.
*/
onChange: (page: number) => void
/**
* Number of sibling pages to show.
*/
siblings?: number
/**
* Number of boundary pages to show.
*/
boundaries?: number
/**
* Pagination size.
*/
size?: Size
/**
* Whether to show first/last buttons.
*/
showFirstLast?: boolean
/**
* Whether to show previous/next buttons.
*/
showPrevNext?: boolean
/**
* Accessible labels for pagination controls.
*/
labels?: {
nav?: string
first?: string
previous?: string
next?: string
last?: string
goToPage?: (page: number) => string
}
}
RadioGroupPropsProps for the RadioGroup component.
interface RadioGroupProps<T = string> extends BaseProps {
/**
* Radio options.
*/
options: RadioOption<T>[]
/**
* Current value.
*/
value?: T
/**
* Change handler.
*/
onChange?: (value: T) => void
/**
* Radio size.
*/
size?: Size
/**
* Group label.
*/
label?: string
/**
* Shared `name` attribute for the group's radio inputs (used for native
* form submission). When omitted, a unique per-instance name is generated
* so separate groups never merge — the visible `label` is deliberately
* NOT used as the name, because two groups with the same label (e.g. two
* "Size" pickers) would otherwise form ONE native radio group and
* deselect each other.
*/
name?: string
/**
* Layout direction.
*/
direction?: 'horizontal' | 'vertical'
/**
* Error message.
*/
error?: string
}
RadioOptionA single option in a RadioGroup.
interface RadioOption<T = string> {
/**
* Option value.
*/
value: T
/**
* Display label.
*/
label: Children
/**
* Whether the option is disabled.
*/
disabled?: boolean
}
SelectElementPropsBase props for select elements.
interface SelectElementProps extends HTMLElementProps {
name?: string
required?: boolean
autoFocus?: boolean
multiple?: boolean
onChange?: ChangeEventHandler
}
SelectOptionA single option in a Select dropdown.
interface SelectOption<T = string> {
/**
* Option value.
*/
value: T
/**
* Display label.
*/
label: string
/**
* Whether the option is disabled.
*/
disabled?: boolean
/**
* Option group (for grouped selects).
*/
group?: string
}
SelectPropsProps for the Select dropdown component (single or multi-select).
interface SelectProps<T = string> extends SelectElementProps {
/**
* Select options.
*/
options: SelectOption<T>[]
/**
* Current value.
*/
value?: T
/**
* Change handler (with typed value).
*/
onValueChange?: (value: T) => void
/**
* Select size.
*/
size?: Size
/**
* Label text.
*/
label?: string
/**
* Placeholder text.
*/
placeholder?: string
/**
* Error message.
*/
error?: string
/**
* Hint/help text.
*/
hint?: string
/**
* Whether to allow clearing the selection.
*/
clearable?: boolean
}
SkeletonPropsProps for the Skeleton loading placeholder component.
interface SkeletonProps extends BaseProps {
/**
* Skeleton width.
*/
width?: string | number
/**
* Skeleton height.
*/
height?: string | number
/**
* Whether the skeleton is circular.
*/
circle?: boolean
/**
* Border radius.
*/
borderRadius?: string | number
/**
* Animation type.
*/
animation?: 'pulse' | 'wave' | 'none'
}
SpacerPropsProps for the Spacer layout component (adds whitespace between elements).
interface SpacerProps extends BaseProps {
/**
* Space size.
*/
size?: Size | string | number
/**
* Whether the spacer is horizontal.
*/
horizontal?: boolean
}
SpinnerPropsProps for the Spinner/loading indicator component.
interface SpinnerProps extends BaseProps {
/**
* Spinner size.
*/
size?: Size
/**
* Spinner color.
*/
color?: ColorVariant | string
/**
* Loading label (for accessibility).
*/
label?: string
/**
* Spinner thickness.
*/
thickness?: number
}
SwitchPropsProps for the Switch/Toggle component.
interface SwitchProps extends InputElementProps {
/**
* Switch label.
*/
label?: Children
/**
* Whether the switch is on.
*/
checked?: boolean
/**
* Switch size.
*/
size?: Size
/**
* Color when on.
*/
color?: ColorVariant
}
TabItemA single tab in a Tabs component.
interface TabItem<T = string> {
/**
* Tab value/id.
*/
value: T
/**
* Tab label.
*/
label: Children
/**
* Tab content.
*/
content?: Children
/**
* Whether the tab is disabled.
*/
disabled?: boolean
/**
* Icon to display.
*/
icon?: Children
}
TableColumnTable column definition.
interface TableColumn<T> {
/**
* Column key (data property).
*/
key: keyof T | string
/**
* Column header.
*/
header: Children
/**
* Custom cell renderer.
*/
render?: (value: unknown, row: T, index: number) => Children
/**
* Column width.
*/
width?: string | number
/**
* Whether the column is sortable.
*/
sortable?: boolean
/**
* Text alignment.
*/
align?: 'left' | 'center' | 'right'
}
TablePropsProps for the Table component.
interface TableProps<T> extends HTMLElementProps {
/**
* Table data.
*/
data: T[]
/**
* Column definitions.
*/
columns: TableColumn<T>[]
/**
* Row key extractor.
*/
rowKey?: keyof T | ((row: T) => string | number)
/**
* Whether to show borders.
*/
bordered?: boolean
/**
* Whether rows are striped.
*/
striped?: boolean
/**
* Whether rows are hoverable.
*/
hoverable?: boolean
/**
* Table size.
*/
size?: Size
/**
* Empty state content.
*/
emptyContent?: Children
/**
* Loading state.
*/
loading?: boolean
/**
* Sort configuration.
*/
sort?: {
key: string
direction: 'asc' | 'desc'
}
/**
* Sort change handler.
*/
onSort?: (key: string, direction: 'asc' | 'desc') => void
/**
* Row click handler.
*/
onRowClick?: (row: T, index: number) => void
}
TabsPropsProps for the Tabs component (switchable tabbed content panels).
interface TabsProps<T = string> extends BaseProps {
/**
* Tab items.
*/
items: TabItem<T>[]
/**
* Current active tab.
*/
value?: T
/**
* Default active tab.
*/
defaultValue?: T
/**
* Change handler.
*/
onChange?: (value: T) => void
/**
* Tab variant.
*/
variant?: 'line' | 'enclosed' | 'soft-rounded' | 'solid-rounded'
/**
* Tab size.
*/
size?: Size
/**
* Whether tabs are fitted (take full width).
*/
fitted?: boolean
}
TextareaElementPropsBase props for textarea elements.
interface TextareaElementProps extends HTMLElementProps {
name?: string
value?: string
defaultValue?: string
placeholder?: string
required?: boolean
readOnly?: boolean
autoFocus?: boolean
rows?: number
cols?: number
maxLength?: number
minLength?: number
wrap?: 'hard' | 'soft' | 'off'
onChange?: ChangeEventHandler
onInput?: FormEventHandler
}
TextareaPropsProps for the Textarea component.
interface TextareaProps extends TextareaElementProps {
/**
* Text size tier (see {@link TextareaClassOptions.size}) — pass the same
* `size` as a neighboring Input for identical font sizes.
*/
size?: Size
/**
* Label text.
*/
label?: string
/**
* Error message.
*/
error?: string
/**
* Hint/help text.
*/
hint?: string
/**
* Whether the textarea auto-resizes.
*/
autoResize?: boolean
/**
* Minimum number of rows.
*/
minRows?: number
/**
* Maximum number of rows.
*/
maxRows?: number
}
ToastPropsProps for the Toast/notification component.
interface ToastProps extends HTMLElementProps {
/**
* Toast content.
*/
children?: Children
/**
* Toast title.
*/
title?: string
/**
* Toast description.
*/
description?: string
/**
* Toast status/type.
*/
status?: ColorVariant
/**
* Duration in milliseconds (0 for persistent).
*/
duration?: number
/**
* Whether the toast is dismissible.
*/
dismissible?: boolean
/**
* Called when dismissed.
*/
onDismiss?: () => void
/**
* Toast position.
*/
position?: 'top' | 'top-right' | 'top-left' | 'bottom' | 'bottom-right' | 'bottom-left'
/**
* Accessible label for the close button.
* @default 'Close'
*/
closeLabel?: string
}
TooltipPropsProps for the Tooltip component (hover/focus popover with informational text).
interface TooltipProps extends HTMLElementProps {
/**
* Tooltip content.
*/
content: Children
/**
* Element that triggers the tooltip.
*/
children: Children
/**
* Tooltip placement.
*/
placement?: TooltipPlacement
/**
* Delay before showing (ms).
*/
delay?: number
/**
* Whether the tooltip has an arrow.
*/
hasArrow?: boolean
}
ButtonVariantButton visual variant styles.
type ButtonVariant = 'solid' | 'outline' | 'ghost' | 'link'
ChangeEventHandlerFramework-agnostic change event handler.
type ChangeEventHandler = EventHandler<Event>
ChildrenFramework-agnostic child content.
Use unknown to allow any framework's node type (ReactNode, VNode, etc.).
type Children = unknown
ColorVariantSemantic color variants used across components for status indication.
type ColorVariant = 'primary' | 'secondary' | 'success' | 'warning' | 'error' | 'info'
EventHandlerFramework-agnostic event handler.
type EventHandler<E = Event> = (event: E) => void
FocusEventHandlerFramework-agnostic focus event handler.
type FocusEventHandler = EventHandler<FocusEvent>
FormEventHandlerFramework-agnostic form event handler.
type FormEventHandler = EventHandler<Event>
InputTypeAllowed HTML input type attribute values for the Input component.
type InputType =
| 'text'
| 'email'
| 'password'
| 'number'
| 'tel'
| 'url'
| 'search'
| 'date'
| 'time'
| 'datetime-local'
KeyboardEventHandlerFramework-agnostic keyboard event handler.
type KeyboardEventHandler = EventHandler<KeyboardEvent>
ModalSizeModal size variants including full-screen.
type ModalSize = 'sm' | 'md' | 'lg' | 'xl' | 'full'
MouseEventHandlerFramework-agnostic mouse event handler.
type MouseEventHandler = EventHandler<MouseEvent>
SizeStandard size scale used across all molecule UI components (buttons, inputs, badges, etc.).
type Size = 'xs' | 'sm' | 'md' | 'lg' | 'xl'
TooltipPlacementPosition where a tooltip renders relative to its trigger element (top, bottom, left, right, and corner variants).
type TooltipPlacement =
'top' | 'bottom' | 'left' | 'right' | 'top-start' | 'top-end' | 'bottom-start' | 'bottom-end'
MoleculeAlertAngular Alert UI component with UIClassMap-driven styling.
MoleculeBadgeAngular Badge UI component with UIClassMap-driven styling.
MoleculeButtonAngular Button UI component with UIClassMap-driven styling.
MoleculeCheckboxAngular Checkbox UI component with UIClassMap-driven styling.
MoleculeInputAngular Input UI component with UIClassMap-driven styling.
MoleculeModalAngular Modal UI component with UIClassMap-driven styling.
centered (default true) vertically centers the dialog; centered: false top-anchors it instead, via getModalWrapperStyle().
MoleculeRadioGroupAngular RadioGroup UI component with UIClassMap-driven styling.
MoleculeSelectAngular Select UI component with UIClassMap-driven styling.
MoleculeSpinnerAngular Spinner UI component with UIClassMap-driven styling.
MoleculeSwitchAngular Switch UI component with UIClassMap-driven styling.
MoleculeToastAngular Toast UI component with UIClassMap-driven styling.
MoleculeTooltipAngular Tooltip UI component with UIClassMap-driven styling.
Wraps child content and shows a tooltip on hover/focus. hasArrow renders
a small themed pointer at the resolved placement edge.
cn(inputs)Merge class names, filtering out falsy values.
function cn(inputs?: (string | false | null | undefined)[]): string
inputs — The inputs.Returns: The resulting string.
getIconSvg(name, className)Generates SVG markup string from an icon name.
function getIconSvg(name: IconName, className: string): string
name — Icon name from the icon setclassName — CSS class for sizingReturns: SVG markup string
getModalWrapperStyle(centered)Get the inline style for the modal centering wrapper. dialogWrapper has
no dedicated ClassMap resolver option (it's a fixed token, not a
{ centered }-parameterized one), so a top-anchored (non-centered) layout
is expressed via the one inline-style exception the workspace styling rule
allows for values ClassMap genuinely cannot express.
A standalone function (rather than a class member) so it's unit-testable
without constructing MoleculeModal — the class can't be new'd outside
an Angular injection context (sanitizer = inject(DomSanitizer) runs at
field-initializer time).
function getModalWrapperStyle(centered: boolean): Record<string, string> | undefined
centered — Whether the modal is vertically centered.Returns: An inline style object, or undefined when centered.
getTooltipArrowStyle(placement)Returns the arrow's inline position style for a given placement. The arrow
has no dedicated ClassMap resolver (tooltip() takes no options), so its
shape/position is expressed via a small inline style — the sanctioned
exception for values ClassMap cannot express. Its color is NOT hardcoded:
var(--color-surface) / var(--color-border) are the same CSS custom
properties the bg-surface/border classes in tooltipContent resolve
to, so the arrow always matches the tooltip body in both themes.
A standalone function (rather than a class member) so it's unit-testable
in isolation, matching getModalWrapperStyle() in modal.component.ts.
function getTooltipArrowStyle(placement: TooltipPlacement): Record<string, string>
placement — The tooltip's resolved placement.Returns: Inline style positioning the rotated-square arrow for that placement.
Peer dependencies:
@angular/core 22.0.0@angular/platform-browser 22.0.0@molecule/app-i18n ^1.0.1@molecule/app-icons ^1.0.1@molecule/app-ui ^1.0.1@angular/core
@angular/platform-browser
@molecule/app-i18n
@molecule/app-icons
@molecule/app-ui
setClassMap() must run before any component renders — every component resolves its
classes through getClassMap(), which THROWS until a ClassMap bond (e.g.
@molecule/app-ui-tailwind) is set. Call it in main.ts before bootstrapApplication.
Components are standalone — add them to the imports array of the consuming component or
route; there is no NgModule.
Event outputs are handle*, not the DOM names: (handleClick) on mol-button,
(handleInput)/(handleChange) on mol-input (both emit the raw DOM event — read the
value from $event.target). The host element uses display: contents, so the real
<button>/<input> lives inside the template.
Translation strings are provided by @molecule/app-locales-ui.