# Pagination ## Description Pagination component helps users easily navigate through content, allowing swift browsing across multiple pages or sections, commonly used in lists, tables, and content-rich interfaces. ## Parameters | Name | Type | Default Value | Description | | :--- | :--- | :------------ | :---------- | | BoundaryCount | `int` | 2 | The number of items at the start and end of the pagination. | | Classes | `BitPaginationClassStyles?` | null | Custom CSS classes for different parts of the pagination. | | Color | `BitColor?` | null | The general color of the pagination. | | Count | `int` | 1 | The total number of pages. | | DefaultSelectedPage | `int` | 0 | The default selected page number. | | FirstButtonIcon | `BitIconInfo?` | null | The icon for the first button using custom CSS classes for external icon libraries. Takes precedence over FirstButtonIconName when both are set. | | FirstButtonIconName | `string?` | null | The built-in icon name for the first button. | | LastButtonIcon | `BitIconInfo?` | null | The icon for the last button using custom CSS classes for external icon libraries. Takes precedence over LastButtonIconName when both are set. | | LastButtonIconName | `string?` | null | The built-in icon name for the last button. | | MiddleCount | `int` | 3 | The number of items to render in the middle of the pagination. | | NextButtonIcon | `BitIconInfo?` | null | The icon for the next button using custom CSS classes for external icon libraries. Takes precedence over NextButtonIconName when both are set. | | NextButtonIconName | `string?` | null | The built-in icon name for the next button. | | OnChange | `EventCallback<int>` | null | The event callback for when selected page changes. | | PreviousButtonIcon | `BitIconInfo?` | null | The icon for the previous button using custom CSS classes for external icon libraries. Takes precedence over PreviousButtonIconName when both are set. | | PreviousButtonIconName | `string?` | null | The built-in icon name for the previous button. | | SelectedPage | `int` | 0 | The selected page number. | | ShowFirstButton | `bool` | false | Determines whether to show the first button. | | ShowLastButton | `bool` | false | Determines whether to show the last button. | | ShowNextButton | `bool` | true | Determines whether to show the next button. | | ShowPreviousButton | `bool` | true | Determines whether to show the previous button. | | Size | `BitSize?` | null | The size of the buttons. | | Styles | `BitPaginationClassStyles?` | null | Custom CSS styles for different parts of the BitPagination. | | Variant | `BitVariant?` | null | The visual variant of the pagination. | | AriaLabel | `string?` | null | Gets or sets the accessible label for the component, used by assistive technologies. | | 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` | false | 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>` | new Dictionary<string, object>() | Captures additional HTML attributes to be applied to the rendered element, in addition to the component's parameters. | | Id | `string?` | null | Gets or sets the unique identifier for the component's root element. | | IsEnabled | `bool` | true | Gets or sets a value indicating whether the component is enabled and can 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` | BitVisibility.Visible | Gets or sets the visibility state (visible, hidden, or collapsed) of the component. | ## Public Members | Name | Type | Default Value | Description | | :--- | :--- | :------------ | :---------- | | UniqueId | `Guid` | Guid.NewGuid() | Gets the readonly unique identifier for the component's root element, assigned when the component instance is constructed. | | RootElement | `ElementReference` | | Gets the reference to the root HTML element associated with this component. | ## Enums ### BitColor Enum | Name | Value | Description | | :--- | :--- | :---------- | | Primary | 0 | Info Primary general color. | | Secondary | 1 | Secondary general color. | | Tertiary | 2 | Tertiary general color. | | Info | 3 | Info general color. | | Success | 4 | Success general color. | | Warning | 5 | Warning general color. | | SevereWarning | 6 | SevereWarning general color. | | Error | 7 | Error general color. | ### BitSize Enum | Name | Value | Description | | :--- | :--- | :---------- | | Small | 0 | The small size. | | Medium | 1 | The medium size. | | Large | 2 | The large size. | ### BitVariant Enum | Name | Value | Description | | :--- | :--- | :---------- | | Fill | 0 | Fill styled variant. | | Standard | 1 | Outline styled variant. | | Text | 2 | Text styled variant. | ### 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 ### BitIconInfo Properties | Name | Type | Default Value | Description | | :--- | :--- | :------------ | :---------- | | Name | `string?` | null | Gets or sets the name of the icon. | | BaseClass | `string?` | null | Gets or sets the base CSS class for the icon. For built-in Fluent UI icons, this defaults to "bit-icon". For external icon libraries like FontAwesome, you might set this to "fa" or leave empty. | | Prefix | `string?` | null | Gets or sets the CSS class prefix used before the icon name. For built-in Fluent UI icons, this defaults to "bit-icon--". For external icon libraries, you might set this to "fa-" or leave empty. | ### BitPaginationClassStyles Properties | Name | Type | Default Value | Description | | :--- | :--- | :------------ | :---------- | | Root | `string?` | null | Custom CSS classes/styles for the root element of the BitPagination. | | Button | `string?` | null | Custom CSS classes/styles for the button of the BitPagination. | | Ellipsis | `string?` | null | Custom CSS classes/styles for the ellipsis of the BitPagination. | | SelectedButton | `string?` | null | Custom CSS classes/styles for the selected button of the BitPagination. | | FirstButton | `string?` | null | Custom CSS classes/styles for the first button of the BitPagination. | | FirstButtonIcon | `string?` | null | Custom CSS classes/styles for the icon of the first button of the BitPagination. | | PreviousButton | `string?` | null | Custom CSS classes/styles for the previous button of the BitPagination. | | PreviousButtonIcon | `string?` | null | Custom CSS classes/styles for the icon of the previous button of the BitPagination. | | NextButton | `string?` | null | Custom CSS classes/styles for the next button of the BitPagination. | | NextButtonIcon | `string?` | null | Custom CSS classes/styles for the icon of the next button of the BitPagination. | | LastButton | `string?` | null | Custom CSS classes/styles for the last button of the BitPagination. | | LastButtonIcon | `string?` | null | Custom CSS classes/styles for the icon of the last button of the BitPagination. | ## Examples \n**Basic**: ```razor ``` \n**Variants**: ```razor ``` \n**Default selected**: ```razor ``` \n**BoundaryCount**: ```razor ``` \n**MiddleCount**: ```razor ``` \n**Navigation buttons**: ```razor ``` \n**Icon**: ```razor ``` \n**Color**: ```razor
Disabled:
``` \n**Size**: ```razor ``` \n**External Icons**: ```razor ``` \n**Style & Class**: ```razor ``` \n**Binding**: ```razor
Changed page: @onChangeSelectedPage
``` ```csharp private int oneWaySelectedPage = 1; private int twoWaySelectedPage = 2; private int onChangeSelectedPage = 3; ``` \n**RTL**: ```razor ```