Forward icon:variant to input action sub-components#2566
Merged
calebporzio merged 1 commit intomainfrom Apr 19, 2026
Merged
Conversation
The `viewable`, `clearable`, `copyable`, and `expandable` sub-components previously hard-coded their icon variants (`micro` or `mini`). This forwards the parent input's `$iconVariant` prop (default `mini`) to all four sub-components, allowing users to customise the icon variant via `icon:variant` on the input.
Contributor
|
Hi, @joshhanley Navbar item trailing icon also hardcoded its variant. Shouldn't it forwarded too or its intended? <flux:navbar class="max-lg:hidden">
<flux:navbar.item :href="route('home', absolute: false)"
icon:trailing="home"
icon:variant="outline"
wire:navigate>Home</flux:navbar.item>
</flux:navbar> |
Contributor
|
thanks Josh! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The Scenario
When using
viewable,clearable,copyable, orexpandableon a<flux:input>, the action icons use hard-coded variants with no way to customise them. Theicon:variantprop on the input only affects leading/trailing icons, not the action sub-components.The Problem
Each action sub-component hard-coded its own icon variant rather than inheriting from the parent input's
$iconVariantprop:viewable.blade.php:variant="micro"clearable.blade.php:variant="micro"expandable.blade.php:variant="micro"copyable.blade.php:variant="mini"The parent
input/index.blade.phpalready acceptedicon:variant(defaulting tomini) but never forwarded it to these sub-components.The Solution
Forward
$iconVariantfrom the parent input component to all four action sub-components (viewable,clearable,copyable,expandable), replacing the hard-coded variants. This allows users to customise the icon variant viaicon:variant:All sub-components now default to
mini(the input's default), which also fixes the inconsistency wherecopyableusedminibut the other three usedmicro.Fixes #2335