import { Attributes, Component } from 'mithril'; import { InputOption } from './option'; export interface RadioButtonsAttrs extends Attributes { /** Element ID */ id?: string; /** Optional title or label */ label?: string; /** The options that you have */ options: InputOption[]; /** Event handler that is called when an option is changed. Optional for uncontrolled mode. */ onchange?: (id: T) => void; /** * Currently selected id for controlled mode. If provided along with `onchange`, the component operates in controlled mode * where the parent manages the state. The parent must update this value in response to `onchange` callbacks. */ checkedId?: T; /** * Default selected id for uncontrolled mode. Only used when `checkedId` and `onchange` are not provided. * The component will manage its own internal state in uncontrolled mode. */ defaultCheckedId?: T; /** Optional description */ description?: string; /** If true, start on a new row */ newRow?: boolean; /** If true, add a mandatory '*' after the label */ isMandatory?: boolean; /** Optional CSS that is added to the input checkbox, e.g. if you add col s4, the items will be put inline */ checkboxClass?: string; /** Disable the button */ disabled?: boolean; /** Layout for the options: 'vertical' (default) or 'horizontal' */ layout?: 'vertical' | 'horizontal'; } export interface RadioButtonAttrs extends Attributes { id: T; checked?: boolean; onchange: (id: T) => void; label: string; groupId: string; disabled?: boolean; /** Optional input id for the radio button */ inputId?: string; } export declare const RadioButton: () => Component>; /** Component to show a list of radio buttons, from which you can choose one. */ export declare const RadioButtons: () => Component>;