maud-ui 0.1.0

58 headless, accessible UI components for Rust web apps. Built on maud + htmx, styled like shadcn/ui.
Documentation
/* RadioGroup component — grouped radio buttons with layout */

.mui-radio-group {
  border: none;
  padding: 0;
  margin: 0;
  display: flex;
  gap: 0.5rem;
}

.mui-radio-group--vertical {
  flex-direction: column;
}

.mui-radio-group--horizontal {
  flex-direction: row;
  flex-wrap: wrap;
  gap: 1rem;
}

.mui-radio-group__legend {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--mui-text);
  margin-bottom: 0.75rem;
}

/* Each radio item — row layout: indicator + label */
.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, 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 with filled inner circle */
.mui-radio__input:checked + .mui-radio__indicator {
  border-color: var(--mui-accent);
}

.mui-radio__input:checked + .mui-radio__indicator::after {
  content: "";
  display: block;
  width: 0.5rem;
  height: 0.5rem;
  background: var(--mui-accent);
  border-radius: var(--mui-radius-full);
}

/* 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:has(.mui-radio__input:disabled) {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

/* 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;
}