kit

Segmented control

Built revision v17.10.0

React
Topics

Human support

Bring a missing role, layout, or state, or a rendering against the standard, to the session working on kit. Name the package and the entry.

On Find, Calendar

Segmented control

Charge by
DayApplies to every booking of this room.

Charge by while bookings cannot be changed.

Charge by
Day
Show bookings as
Show bookings as
Source
let views: KitReact.Roles.SegmentedControl.options = Three(
  {value: "list", icon: KitReact.Icons.iconList, content: React.string("List")},
  {value: "board", icon: KitReact.Icons.iconKanban, content: React.string("Board")},
  {value: "calendar", icon: KitReact.Icons.iconCalendarBlank, content: React.string("Calendar")},
)

@react.component
let make = () => {
  <>
    <KitReact.Roles.FormGroup
      id="react-segmented-charge" printedValue={React.string("Day")}
      label={React.string("Charge by")}
      help={React.string("Applies to every booking of this room.")}
      kind={KitReact.Roles.SegmentedControl.controlSet({
        name: "charge",
        value: "day",
        options: Three(
          {value: "hour", content: React.string("Hour")},
          {value: "day", content: React.string("Day")},
          {value: "week", content: React.string("Week")},
        ),
      })}
    />
    <p className="specimen-case-line"> {React.string("Charge by while bookings cannot be changed.")} </p>
    <KitReact.Roles.FormGroup
      id="react-segmented-charge-disabled" printedValue={React.string("Day")}
      label={React.string("Charge by")}
      kind={KitReact.Roles.SegmentedControl.controlSet({
        name: "charge-disabled",
        value: "day",
        options: Three(
          {value: "hour", content: React.string("Hour"), props: {disabled: true}},
          {value: "day", content: React.string("Day"), props: {disabled: true}},
          {value: "week", content: React.string("Week"), props: {disabled: true}},
        ),
      })}
    />
    <KitReact.Roles.FormGroup
      id="react-segmented-view"
      label={React.string("Show bookings as")}
      kind={KitReact.Roles.SegmentedControl.controlSet({name: "view", value: "list", options: views})}
    />
    <KitReact.Roles.FormGroup
      id="react-segmented-view-narrow"
      label={React.string("Show bookings as")}
      props={{style: {inlineSize: "var(--kit-field-medium)"}}}
      kind={KitReact.Roles.SegmentedControl.controlSet({name: "view-narrow", value: "board", options: views})}
    />
  </>
}