ColorSchemeSwitch
IzzyBlazor.ColorSchemeSwitch in the IzzyBlazor.Core package, generated from the 0.1.0-alpha.17 assembly
and its doc comments.
Properties (5)
VariantColorSchemeSwitchVariant = ColorSchemeSwitchVariant.MenuHow it looks: ColorSchemeSwitchVariant.Menu (an icon button with a menu, the default), ColorSchemeSwitchVariant.Toggle or ColorSchemeSwitchVariant.Segmented.
@bind-ValueColorScheme?The chosen scheme. Leave it unset to show the user's choice from the cookie. Bind it on interactive pages to follow the user's choice; setting it from C# there applies that scheme to the page, the cookie and other tabs, as a click would.
IconOnlybool = falseSegmented only: icons without the labels (the names stay for screen readers and as tooltips).
SizeControlSize = ControlSize.MdHeight. Defaults to medium, the size of a header's icon buttons.
Labelstring? = "Color scheme"The button's or group's accessible name. Defaults to "Color scheme".
Item props (from LayoutItemBase)
Margin on all sides, in spacing steps (-16 to 16; one step = 4px).
Width.
Minimum width.
Maximum width.
Growbool = falseWhether to grow into free space inside a Stack, Row or Column: <Box Grow>.
Shrinkbool = trueWhether to shrink when space is short inside a Stack, Row or Column. Defaults to true; Shrink="false" keeps the size.
Starting size inside a Stack, before growing or shrinking.
Alignment across the parent's direction, overriding the parent's Align for this component only, such as a button lined up with the bottom of labeled fields in a Row.
Common props (from IzzyComponentBase)
Classstring?Extra CSS classes, merged after the component's own classes.
Stylestring?Inline style, appended after the component's generated custom properties.
VisibleFromBreakpoint?Shows the component only from this breakpoint up, such as header links for wide screens.
Events (0)
No events.
Types (3)
ColorScheme
enumLight, dark, or automatic. For the app (ColorScheme, the user's pick in a ColorSchemeSwitch), ColorScheme.Auto follows the device. For part of a page (ColorScheme on Box and the App layout parts), ColorScheme.Auto follows the page, and ColorScheme.Inverse is the opposite of it. Every color token switches with the scheme, so links, buttons, badges, fields and focus rings inside keep their contrast.
| Value | Description |
|---|---|
Auto | Follow the device for the app, or the page for part of it (the default). |
Light | Always light. |
Dark | Always dark, such as a dark sidebar in a light app. |
Inverse | For part of a page: the opposite of the page, dark on a light page and light on a dark one. |
ColorSchemeSwitchVariant
enumHow a ColorSchemeSwitch looks.
| Value | Description |
|---|---|
Menu | An icon button (sun or moon) that opens a menu: System, Light, Dark. The default. |
Toggle | One icon button that flips between light and dark. |
Segmented | System, Light and Dark side by side, for a settings page. |
ControlSize
enumThe height of interactive controls. Shared by buttons and form fields, so a button and an input of the same size line up in a row.
| Value | Description |
|---|---|
Sm | 32px tall, small text. |
Md | 36px tall (the default). |
Lg | 44px tall, large text. For touch-first and marketing pages. |