Skip to content
# Params ## Description BitParams cascades shared default parameters to every bit BlazorUI component in a subtree, so a toolbar, a form or a whole app sets them once. Each component reads the params object of its own type (BitButtonParams, BitTagParams, ...), and a parameter it sets itself always wins. ## Notes A params object fills in only what a component leaves unset, one parameter at a time. BitParams re-reads its objects on every render and tells the components below only when a value actually changed, so rebuilding the list inline or changing a property of one of its objects is fine; a parameter an object stops setting goes back to what the component held before. For values of your own, use BitCascadingValueProvider. ## Parameters | Name | Type | Default Value | Description | | :--- | :--- | :------------ | :---------- | | ChildContent | `RenderFragment?` | null | The content to which the values should be provided. | | Isolated | `bool` | false | Ignores the params objects the BitParams ancestors provide, so the components below take their defaults from this one alone. | | Parameters | `IEnumerable<IBitComponentParams>?` | null | The params objects to provide, one per component type (BitButtonParams, BitTagParams, ...). A later or nested object of the same type only replaces the parameters it sets. | ## Enums ### BitVisibility Enum | Name | Value | Description | | :--- | :--- | :---------- | | Visible | 0 | The content of the component is visible. | | Hidden | 1 | The content of the component is hidden, but the space it takes on the page remains (visibility:hidden). | | Collapsed | 2 | The component is hidden (display:none). | ### BitDir Enum | Name | Value | Description | | :--- | :--- | :---------- | | Ltr | 0 | Ltr (left to right) is to be used for languages that are written from the left to the right (like English). | | Rtl | 1 | Rtl (right to left) is to be used for languages that are written from the right to the left (like Arabic). | | Auto | 2 | Auto lets the user agent decide. It uses a basic algorithm as it parses the characters inside the element until it finds a character with a strong directionality, then applies that directionality to the whole element. | ## Sub Classes ### IBitComponentParams Properties Implemented by every <Component>Params class; its Name is what the component reads it by. | Name | Type | Default Value | Description | | :--- | :--- | :------------ | :---------- | | Name | `string` | | The cascading name the component reads the params object by (its ParamName constant). | ### BitComponentBaseParams Properties The base class of every <Component>Params class: the parameters every component inherits from BitComponentBase. A null value is left unset. | Name | Type | Default Value | Description | | :--- | :--- | :------------ | :---------- | | AriaLabel | `string?` | null | Gets or sets the accessible label for the component, used by assistive technologies. Every component that reads it is announced by the same name, so share it only between components that do the same thing. | | Class | `string?` | null | Gets or sets the CSS class name(s) to apply to the rendered element. | | Dir | `BitDir?` | null | Gets or sets the text directionality for the component's content. | | ForceAnimation | `bool?` | null | Gets or sets a value indicating whether the component's animations play at their full duration even when reduced motion is requested. | | HtmlAttributes | `Dictionary<string, object>?` | null | Additional HTML attributes for the root element. A nested object of the same type adds its entries to the outer ones. | | Id | `string?` | null | Gets or sets the unique identifier for the component's root element. Every component that reads it gets the same id, so share it only with a single component. | | Disabled | `bool?` | null | Gets or sets a value indicating whether the component is disabled and cannot respond to user interaction. | | Style | `string?` | null | Gets or sets the CSS style string to apply to the rendered element. | | TabIndex | `string?` | null | Gets or sets the tab order index for the component when navigating with the keyboard. | | Visibility | `BitVisibility?` | null | Gets or sets the visibility state (visible, hidden, or collapsed) of the component. | ### BitInputBaseParams<TValue> Properties The base class of the params of an input: BitComponentBaseParams plus the parameters every input inherits from BitInputBase. What identifies a single field (Value, Name, DisplayName) is left out. | Name | Type | Default Value | Description | | :--- | :--- | :------------ | :---------- | | ReadOnly | `bool?` | null | Makes the input read-only. | | Required | `bool?` | null | Makes the input required. | ## Examples \n**Basic**: ```razor Save Share Delete
``` ```csharp private readonly List basicParams = [ new BitButtonParams { Variant = BitVariant.Outline, Color = BitColor.Tertiary, Size = BitSize.Small }, new BitTagParams { Variant = BitVariant.Fill, Color = BitColor.Tertiary, Size = BitSize.Small }, ]; ``` \n**Changing values**: ```razor Accept Decline ``` ```csharp private bool isCompact = true; ``` \n**Nesting**: ```razor Outer: Edit Copy Nested (Color only): Delete Purge Isolated: Defaults ``` ```csharp private readonly List outerParams = [ new BitButtonParams { Variant = BitVariant.Outline, Size = BitSize.Small }, ]; private readonly List dangerParams = [ new BitButtonParams { Color = BitColor.Error }, ]; ```