{"id":37056788,"url":"https://github.com/rob-newman/blzr.bootstrap-select","last_synced_at":"2026-01-14T06:25:41.692Z","repository":{"id":37892921,"uuid":"347977681","full_name":"Rob-Newman/blzr.bootstrap-select","owner":"Rob-Newman","description":"A JavaScript free Blazor component for creating bootstrap select elements.","archived":false,"fork":false,"pushed_at":"2025-10-29T12:01:59.000Z","size":7701,"stargazers_count":20,"open_issues_count":7,"forks_count":6,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-10-29T12:28:02.356Z","etag":null,"topics":["blazor","blazor-component","blazor-server","blazor-webassembly","bootstrap","csharp","dropdown","select"],"latest_commit_sha":null,"homepage":"https://rob-newman.github.io/blzr.bootstrap-select/","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Rob-Newman.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2021-03-15T13:20:52.000Z","updated_at":"2025-10-29T11:59:31.000Z","dependencies_parsed_at":"2024-09-18T11:44:28.902Z","dependency_job_id":"7c69e60d-9074-4240-87a1-678c880b9b8c","html_url":"https://github.com/Rob-Newman/blzr.bootstrap-select","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/Rob-Newman/blzr.bootstrap-select","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Rob-Newman%2Fblzr.bootstrap-select","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Rob-Newman%2Fblzr.bootstrap-select/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Rob-Newman%2Fblzr.bootstrap-select/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Rob-Newman%2Fblzr.bootstrap-select/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Rob-Newman","download_url":"https://codeload.github.com/Rob-Newman/blzr.bootstrap-select/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Rob-Newman%2Fblzr.bootstrap-select/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28412211,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T05:26:33.345Z","status":"ssl_error","status_checked_at":"2026-01-14T05:21:57.251Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["blazor","blazor-component","blazor-server","blazor-webassembly","bootstrap","csharp","dropdown","select"],"created_at":"2026-01-14T06:25:41.635Z","updated_at":"2026-01-14T06:25:41.684Z","avatar_url":"https://github.com/Rob-Newman.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# blzr.bootstrap-select\n\nThis [Blazor](https://dotnet.microsoft.com/apps/aspnet/web-apps/blazor) bootstap select component is inspired by the js [bootstrap-select](https://github.com/snapappointments/bootstrap-select/), rewritten using C# as a Razor Component.\n\nThere is no dependency with JavaScript.\n\n![Nuget](https://img.shields.io/nuget/v/blzr.bootstrapselect.svg)\n\n[![Build, Test \u0026 Deploy](https://github.com/Rob-Newman/blzr.bootstrap-select/actions/workflows/build.yml/badge.svg)](https://github.com/Rob-Newman/blzr.bootstrap-select/actions/workflows/build.yml)\n\n[![Build history](https://buildstats.info/github/chart/rob-newman/blzr.bootstrap-select?branch=main\u0026includeBuildsFromPullRequest=false)](https://github.com/rob-newman/blzr.bootstrap-select/actions?query=branch%3Amain++)\n\n\u003cimg alt=\"Screenshot of component in action\" src=\"screenshot.gif\" data-canonical-src=\"screenshot.gif\" width=\"800\" /\u003e\n\nTo see it in action, visit [https://rob-newman.github.io/blzr.bootstrap-select/](https://rob-newman.github.io/blzr.bootstrap-select/)\n\n## Getting Setup\n\nYou can install the package via the NuGet package manager just search for *Blzr.BootstrapSelect*. You can also install via powershell using the following command.\n\n```powershell\nInstall-Package Blzr.BootstrapSelect\n```\n\nOr via the dotnet CLI.\n\n```bash\ndotnet add package Blzr.BootstrapSelect\n```\n\n### 1. Register Services\nYou will need to register the Blzr.BootstrapSelect service in your application\n\n#### Blazor WebAssembly\nAdd the following line to your applications `Program.Main` method.\n\n```csharp\nbuilder.Services.AddBootstrapSelect();\n```\n\n#### Blazor Server\nAdd the following line to your applications `Startup.ConfigureServices` method.\n\n```csharp\nservices.AddBootstrapSelect();\n```\n\n### 2. Add Imports\nAdd the following to your *_Imports.razor*\n\n```csharp\n@using Blzr.BootstrapSelect\n```\n\n### 3. Add reference to style sheet(s)\nAdd the following line to the `head` tag of your `_Host.cshtml` (Blazor Server app) or `index.html` (Blazor WebAssembly).\n\nWe ship both minified and unminified CSS.\n\nFor minified use:\n\n```HTML\n\u003clink href=\"_content/Blzr.BootstrapSelect/blzr-bootstrap-select.min.css\" rel=\"stylesheet\" /\u003e\n```\n\nFor unminified use:\n```HTML\n\u003clink href=\"_content/Blzr.BootstrapSelect/blzr-bootstrap-select.css\" rel=\"stylesheet\" /\u003e\n```\n\nPresumably, you already have bootstrap css referenced in your project. If not, use:\n```HTML\n\u003clink rel=\"stylesheet\" href=\"https://cdn.jsdelivr.net/npm/bootstrap@4.5.3/dist/css/bootstrap.min.css\" integrity=\"sha384-TX8t27EcRE3e/ihU7zmQxVncDAy5uIKz4rEkgIXeMed4M0jlfIDPvg6uqKI2xXr2\" crossorigin=\"anonymous\"\u003e\n```\n\n## Defaults\nThe following system wide defaults can be configured as part of the service registration\n\n|Name|Type|Default|Description|\n| -- | -- |------ | ---------|\n|`ShowSearch`|`bool`|`false`|Determines if the search box should be displayed. When true, adds a search box to the top of the drop down (works in conjunction with `ShowSearchThreshold`)|\n|`ShowSearchThreshold`|`int`|`0`|The threshold to determine the number of options that must exists before the search box is displayed|\n|`SearchPlaceholderText`|`string`|`\"Search\"`|The placeholder text displayed in the search box|\n|`SearchNotFoundText`|`string`|`\"No matching results\"`|The text displayed if no options match a search term|\n|`DelayValueChangedCallUntilClose`|`bool`|`false`|For multi's only, whether to delay calling ValueChanged until after the select is closed (default will fire after each option is selected/deselected)|\n|`SelectedTextFormat`|`SelectedTextFormats`|`SelectedTextFormats.Values`|Specifies how the selection is displayed with a multi select. `Values` displays a list of the selected options (separated by `MultiSeparator`). `Static` simply displays the select element's placeholder text. `Count` displays the total number of selected options.  `CountGreaterThan` behaves like `Values` until the number of selected options is greater than `SelectedTextFormatCount` where it then behaves like `Count`|\n|`SelectedTextFormatCount`|`int`|`0`|If `SelectedTextFormat` is `CountGreaterThan`, ths is the number of options that must be selected for the `Count` format to be applied|\n|`MultiSelectedText`|`string`|`\"{0} of {1} selected\"`|Specifies the text to display when the `SelectedTextFormat` is `count`. `{0}` is replaced with the number of selected items. `{1}` is replaced with the total number of options|\n|`MultiSeparator`|`string`|`\", \"`|The separator used for multi selected text when the format is `Values`|\n|`ShowPlaceholder`|`bool`|`false`|For singles only, determines if the placeholder text should be displayed|\n|`MultiPlaceholderText`|`string`|`\"Nothing selected\"`|The text to display as the placeholder for multi's|\n|`SinglePlaceholderText`|`string`|`\"Select...\"`|The text to display as the placeholder for singles|\n|`ShowTick`|`bool`|`false`|Whether to show the checkmark on singles|\n|`MaxSelectionsText`|`string`|`\"Limit reached ({0} items max)\"`|The text to display if the max number of selections is met. `{0}` is replaced with the `MaxSelections` parameter|\n|`SearchStyle`|`SearchStyles`|`SearchStyles.Contains`|When set to `SearchStyles.Contains`, searching will reveal options that contain the searched text.  When set to `SearchStyles.StartsWith`, searching will reveal options that start with the searched text|\n|`ShowActions`|`bool`|`false`|For multi's only. When set, adds two buttons to the top of the dropdown menu (Select All and Deselect All)|\n|`SelectAllText`|`string`|`\"Select All\"`|The text to display on the select all button|\n|`DeselectAllText`|`string`|`\"Deselect All\"`|The text to display on the deselect all button|\n|`ButtonStyle`|`ButtonStyles`|`ButtonStyles.Default`|The button class to use to style the select button|\n|`IsOverlayEnabled`|`bool`|`true`| If disabled, the user must manually close the input rather than unfocusing.|\n|`DropMenuPosition`|`DropMenuPositions`|`DropMenuPositions.Down`| Whether the drop down menu opens up or down (above or below) the drop down.|\n\n### Example\n```csharp\nbuilder.Services.AddBootstrapSelect(defaults =\u003e\n                {\n                    defaults.ShowSearch = true;\n                    defaults.SearchPlaceholderText = \"Find\";\n                    defaults.ShowSearchThreshold = 10;\n                    defaults.SearchNotFoundText = \"Can't find any\";\n                    defaults.DelayValueChangedCallUntilClose = true;\n                    defaults.SelectedTextFormat = SelectedTextFormats.CountGreaterThan;\n                    defaults.SelectedTextFormatCount = 2;\n                    defaults.MultiSelectedText = \"{0} selected\";\n                    defaults.MultiSeparator = \"|\";\n                    defaults.ShowPlaceholder = true;\n                    defaults.MultiPlaceholderText = \"Pick some\";\n                    defaults.SinglePlaceholderText = \"Pick one\";\n                    defaults.ShowTick = true;\n                    defaults.MaxSelectionsText = \"Too Many ({0} is max!)\";\n                    defaults.SearchStyle = SearchStyles.StartsWith;\n                    defaults.ShowActions = true;\n                    defaults.SelectAllText = \"All of them\";\n                    defaults.DeselectAllText = \"None of them\";\n                    defaults.ButtonStyle = ButtonStyles.Success;\n                    defaults.IsOverlayEnabled = false;\n                    defaults.DropMenuPosition = DropMenuPositions.Up;\n                });\n```\n\n## Usage\n\n### Basic Example\n```csharp\n@page \"/\"\n\n\u003cBootstrapSelect TItem=\"Country\" Data=\"@countries\" TextField=\"@((item) =\u003e item.Name)\" \n                 ValueField=\"@((item) =\u003e item.Id.ToString())\" TType=\"string\" /\u003e\n\n@code {\n    private IList\u003cCountry\u003e countries;\n\n    protected override void OnInitialized()\n    {\n        countries = new List\u003cCountry\u003e {\n            new Country { Id = 1, Name = \"United Kingdom\" },\n            new Country { Id = 2, Name = \"United States\" },\n            new Country { Id = 3, Name = \"Germany\" },\n            new Country { Id = 4, Name = \"France\" },\n            new Country { Id = 5, Name = \"China\" }\n        };\n    }\n\n    public class Country\n    {\n        public int Id { get; set; }\n\n        public string Name { get; set; }\n    }\n}\n```\n### Parameters\n|Name|Type|Default|Required/Optional|Description|\n| -- | -- |------ | ------ |---------- |\n|`TItem`|`type`|N/A|Required|The underlying type of the objects used in the Data collection|\n|`TType`|`type`|N/A|Required|The underlying type of the Value field.  Currently supported is: `string`, `int`, `IEnumerable\u003cstring\u003e`, `IEnumerable\u003cint\u003e`|\n|`Data`|`IEnumerable\u003cTItem\u003e`|`null`|Required|The Data to use to build the drop down options from|\n|`TextField`|`Func\u003cTItem, string\u003e`|`null`|Required|The `Func` to select the Text value from each item within `Data`|\n|`ValueField`|`Func\u003cTItem, string\u003e`|`null`|Required|The `Func` to select the Value value from each item within `Data`|\n|`SubTextField`|`Func\u003cTItem, string\u003e`|`null`|Optional|The `Func` to select the SubText value from each item within `Data`. SubText is displayed as text-muted.|\n|`IconField`|`Func\u003cTItem, string\u003e`|`null`|Optional|The `Func` to select the Icon (css-class) value from each item within `Data`. Icon is displayed in front of dropdown item.|\n|`OptGroupField`|`Func\u003cTItem, string\u003e`|`null`|Optional|The `Func` to select the Opt Group value from each item within `Data`. If this is supplied, opt groups will be displayed, and its assumed that the `Data` will be sorted so that all items from the same opt group are positioned together|\n|`KeyWordsField`|`Func\u003cTItem, IEnumerable\u003cstring\u003e\u003e`|`null`|Optional|The `Func` to select the Key Words list from each item within `Data`. If this is supplied, the key words will be included when performing serching|\n|`Id`|`string`|`null`|Optional|Html Id to be added to the element|\n|`Value`|`TType`|`null`|Optional|An initial value for the select.  Can be used for 2 way binding using `@bind-value`|\n|`ValueChanged`|`EventCallback\u003cTType\u003e`|`null`|Optional|An `EventCallback` to be called when the value changes|\n|`IsMultiple`|`bool`|`false`|Optional|Determines if the select should be a single or multi|\n|`ShowSearch`|`bool`|Uses system wide Defaults|Optional|Determines if the search box should be displayed. When true, adds a search box to the top of the drop down (works in conjunction with `ShowSearchThreshold`)|\n|`ShowSearchThreshold`|`bool`|Uses system wide Defaults|Optional|The threshold to determine the number of options that must exists before the search box is displayed|\n|`DelayValueChangedCallUntilClose`|`bool?`|Uses system wide Defaults|Optional|For multi's only, whether to delay calling ValueChanged until after the select is closed (default will fire after each option is selected/deselected)|\n|`SelectedTextFormat`|`SelectedTextFormats?`|Uses system wide Defaults|Optional|Specifies how the selection is displayed with a multi select. `Values` displays a list of the selected options (separated by a ,). `Static` simply displays the select element's placeholder text. `Count` displays the total number of selected options.  `CountGreaterThan` behaves like `Values` until the number of selected options is greater than `SelectedTextFormatCount`|\n|`SelectedTextFormatCount`|`int?`|Uses system wide Defaults|Optional|If `SelectedTextFormat` is `CountGreaterThan`, ths is the number if options that must be selected until the message is displayed|\n|`ShowPlaceholder`|`bool?`|Uses system wide Defaults|Optional|For singles only, determines if the placeholder text should be displayed|\n|`PlaceholderText`|`string`|Uses system wide Defaults|Optional|)The placeholder text|\n|`Width`|`string`|`null`|Optional|If supplied, will be used to add a width to the element|\n|`CssClass`|`string`|`null`|Optional|Additional classes to be added to the element|\n|`Label`|`string`|`null`|Optional|A label to added to the element|\n|`ValidationFor`|`Expression\u003cFunc\u003cTType\u003e\u003e`|`null`|Optional|A `Expression` to provide the validation information. Can only be used if component is within an `EditForm`|\n|`ShowTick`|`bool?`|Uses system wide Defaults|Optional|Whether to show the checkmark on singles|\n|`MaxSelections`|`int?`|`null`|Optional|For multi's only, if supplied, limit the number of options that can be selected|\n|`SearchStyle`|`SearchStyles?`|Uses system wide Defaults|Optional|When set to `SearchStyles.Contains`, searching will reveal options that contain the searched text.  When set to `SearchStyles.StartsWith`, searching will reveal options that start with the searched text|\n|`ShowActions`|`bool?`|Uses system wide Defaults|Optional|For multi's only. When set, adds two buttons to the top of the dropdown menu (Select All and Deselect All)|\n|`ButtonStyle`|`ButtonStyles?`|Uses system wide Defaults|Optional|The button class to use to style the select button|\n|`Disabled`|`bool`|`false`|Optional|Option for disabling the button dropdown element|\n|`IsOverlayEnabled`|`bool`|`true`|Optional|If disabled, the user must manually close the input rather than unfocusing.|\n|`DropMenuPosition`|`DropMenuPositions`|`DropMenuPositions.Down`|Optional| Whether the drop down menu opens up or down (above or below) the drop down.|\n\nSee the code in the index page within samples for more examples\n\n## Preview builds and NuGet feed\n\nAll official release packages are published to the official and public NuGet feed using the official version number.\n\nPreview builds (builds from the `main` branch) produce unofficial pre-release packages which can be pulled from the [project's NuGet feed on GitHub](https://github.com/Rob-Newman?tab=packages\u0026repo_name=blzr.bootstrap-select).\n\nThese packages are being versioned using a datetime string (year.month \u0026 day.hour \u0026minute - all with leading zeros removed) as the package version.\n\nAll other builds, such as builds triggered by pull requests produce a NuGet package which can be downloaded as an artifact from the individual GitHub action using the above versioning.\n\n## Contributing\n\nEveryone is welcome to contribute to Blzr.BootstrapSelect. Please take a moment to review the [contributing guidelines](CONTRIBUTING.md).\n\n## License\n\nLicensed under the MIT license.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frob-newman%2Fblzr.bootstrap-select","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frob-newman%2Fblzr.bootstrap-select","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frob-newman%2Fblzr.bootstrap-select/lists"}