Skip to content

Add :to prop to button component #394

@MahmoudGhalayini

Description

@MahmoudGhalayini

Description:

I'd like to propose adding a :to prop to the button component to enable Vue Router navigation functionality. This would allow buttons to act as navigation links while maintaining their visual styling and behavior.

Usage:

<fwb-button :to="/dashboard">Go to Dashboard</fwb-button>
<fwb-button :to="{ name: 'user-profile', params: { id: 123 } }">View Profile</fwb-button>

Benefits:

  • Seamless integration with Vue Router
  • Maintains button styling while providing navigation
  • Consistent API with router-link functionality

I'm happy to implement this feature if there's interest. The implementation would render a router-link internally when the :to prop is provided, while falling back to a regular tag element otherwise.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions