Skip to content

RemixSelect: trigger trailing icon is hardcoded and cannot be customized #53

Description

@tilucasoli

Summary

The trailing arrow icon in RemixSelect's trigger is hardcoded to Icons.keyboard_arrow_up / Icons.keyboard_arrow_down with no public API to customize it. The shared style spec also prevents styling the leading and trailing icons independently.

Current Behavior

RemixSelectTrigger only exposes two fields:

class RemixSelectTrigger {
  final String placeholder;
  final IconData? icon; // leading icon only
  const RemixSelectTrigger({required this.placeholder, this.icon});
}

The trailing icon is hardcoded inside _RemixSelectTriggerWidget at packages/remix/lib/src/components/select/select_widget.dart:351-356:

StyledIcon(
  icon: isOpen
      ? Icons.keyboard_arrow_up
      : Icons.keyboard_arrow_down,
  styleSpec: spec.icon,
),

Additionally, both the leading icon (line 348) and the trailing icon (line 351) share the same spec.icon style slot, so even via styling there's no way to differentiate them.

Proposed Solution

  1. Add fields to RemixSelectTrigger to override the trailing icon — likely a pair for the two states so the open/close affordance is preserved, with sensible defaults to keep this non-breaking:

    final IconData trailingIconCollapsed; // default: Icons.keyboard_arrow_down
    final IconData trailingIconExpanded;  // default: Icons.keyboard_arrow_up
  2. Add a separate trailingIcon slot to RemixSelectTriggerSpec (alongside the existing icon for the leading slot) so each icon can be styled independently.

Acceptance Criteria

  • RemixSelectTrigger exposes a way to override the trailing icon(s) for collapsed/expanded states
  • Trailing icon has its own style slot in RemixSelectTriggerSpec, separate from the leading icon
  • Defaults preserve current visual behavior (no breaking change)
  • Tests updated to cover custom trailing icon and independent styling

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Fields

    No fields configured for Feature.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions