Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(tag-component): tag component #955

Open
wants to merge 1 commit into
base: next
Choose a base branch
from
Open

Conversation

dilandoogan
Copy link
Contributor

@dilandoogan dilandoogan commented Nov 6, 2024

Figma Design Document

https://www.figma.com/design/RrcLH0mWpIUy4vwuTlDeKN/Baklava-Design-Guide?node-id=25001-1763&t=xA7DTWjCkA2EqaDc-1

Implementation

General usage example:

<bl-tag>In Progress</bl-tag>

Usage Examples

Selectable variant usage:

<bl-tag @bl-tag-click="handleTagClick" selected>Selectable tag</bl-tag>

The removable variant can be set like this:

const handleTagClick=(event)=>{
   tags.filter((tag)=>tag.value!==event.value)
}
<bl-tag variant="removable" @bl-tag-click="handleTagClick">Removable tag</bl-tag>

The icon can be set like this:

<bl-tag icon="info">Default</bl-tag>

The size and disabled attributes can be set like this:

<bl-tag size="large" disabled>In Progress</bl-tag>

API Reference:

Slots

Name Description Default Content
icon slot Icon of the tag -

Attributes

Attribute Description Default Value
size (string) Size of tag(small,medium,large) medium
icon (bl-icon) Name of the icon that will be shown in tag -
variant (string) Variants of the tag(selectable,removable) selectable
disabled (boolean) Makes tag disabled false
selected (boolean) Makes tag selected false
value (string) Sets tags value -

Events

Name Description Payload
bl-tag-click Fires when tag is clicked {value:string,selected:boolean}

@dilandoogan dilandoogan changed the title feat(tag-component): tag component adr feat(tag-component): tag component Nov 6, 2024
Copy link
Collaborator

@erbilnas erbilnas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In my opinion we should also add a tag-group wrapper to get all selected tags' ids. Also using bl-click instead of bl-tag-click is enough I guess

@AykutSarac
Copy link
Member

In my opinion we should also add a tag-group wrapper to get all selected tags' ids. Also using bl-click instead of bl-tag-click is enough I guess

Yes, that's in the roadmap but we decided to develop the tag first and group element later.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants