maud-ui 0.1.0

58 headless, accessible UI components for Rust web apps. Built on maud + htmx, styled like shadcn/ui.
Documentation
/* Radio component — shadcn/ui-grade styling */

.mui-radio {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  cursor: pointer;
  user-select: none;
}

/* Visually-hidden native input — fully accessible, invisible */
.mui-radio__input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Indicator — 16px circle, 1px border */
.mui-radio__indicator {
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
  border: 1px solid var(--mui-border);
  border-radius: var(--mui-radius-full);
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--mui-transition);
  margin-top: 0.125rem; /* align with first line of text */
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

/* Checked state — accent border, inner dot */
.mui-radio__input:checked + .mui-radio__indicator {
  background: transparent;
  border-color: var(--mui-accent);
  border-width: 1px;
}

/* Inner dot — 8px filled circle */
.mui-radio__input:checked + .mui-radio__indicator::after {
  content: "";
  display: block;
  width: 0.5rem;
  height: 0.5rem;
  border-radius: var(--mui-radius-full);
  background: var(--mui-accent);
}

/* Focus-visible ring */
.mui-radio__input:focus-visible + .mui-radio__indicator {
  outline: 2px solid var(--mui-border-focus);
  outline-offset: 2px;
}

/* Disabled — reduced opacity, not-allowed cursor */
.mui-radio--disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

.mui-radio--disabled .mui-radio__indicator {
  cursor: not-allowed;
}

/* Label — 0.875rem, medium weight */
.mui-radio__label {
  color: var(--mui-text);
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.25;
}

/* Description text below label — smaller, muted */
.mui-radio__description {
  color: var(--mui-text-muted);
  font-size: 0.8125rem;
  line-height: 1.4;
  margin-top: 0.125rem;
}

/* Label+description wrapper for vertical text stacking */
.mui-radio__text {
  display: flex;
  flex-direction: column;
  gap: 0;
}