v2.15.0

ProseField

Подробная документация настраиваемых элементов API.

Использование

Поле, пропс или параметр для показа в содержимом.

name
string required
description можно задать пропсом или в слоте по умолчанию — с полной поддержкой markdown.
::field{name="name" type="string" required}
`description` можно задать пропсом или в слоте по умолчанию — с полной поддержкой **markdown**.
::

API

Пропсы

Prop Default Type
as'div'any

The element or component this component should render as.

name string

The name of the field.

type string

Expected type of the field's value

description string

Description of the field

requiredboolean

Indicate whether the field is required

b24ui { root?: SlotClass; container?: SlotClass; name?: SlotClass; wrapper?: SlotClass; required?: SlotClass; type?: SlotClass; description?: SlotClass; }

Слоты

Slot Type
default{}

Тема

https://github.com/bx-shef/b24-ui/tree/main/src/theme/field.ts
export default {
  slots: {
    root: 'my-[20px]',
    container: 'flex items-center gap-3 font-[family-name:var(--ui-font-family-system-mono)] text-(length:--ui-font-size-sm)',
    name: 'font-(--ui-font-weight-semi-bold) text-(--ui-color-accent-main-primary)',
    wrapper: 'flex-1 flex items-center gap-1.5 text-(length:--ui-font-size-xs)',
    required: 'rounded-(--ui-border-radius-sm) bg-(--ui-color-design-outline-alert-content)/10 text-(--ui-color-accent-main-alert) px-1.5 py-0.5',
    type: 'rounded-(--ui-border-radius-sm) bg-(--ui-color-design-tinted-na-bg) text-description px-1.5 py-0.5',
    description: 'mt-3 text-description text-(length:--ui-font-size-sm) [&_code]:text-(length:--ui-font-size-xs)/4'
  }
}