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

Card component API #7008

Open
jouni opened this issue Jan 7, 2025 · 1 comment
Open

Card component API #7008

jouni opened this issue Jan 7, 2025 · 1 comment
Labels
component enhancement New feature or request

Comments

@jouni
Copy link
Member

jouni commented Jan 7, 2025

Describe your motivation

Add API, and tests, for setting/adding content to the Card component slots.

Describe the solution you'd like

Slots

Content (default slot)

public void add(Component... content);
// …and all the rest of the HasComponents API

Media

public void setMedia(Component media)
public Component getMedia()

Title

public void setTitle(Component title)
public Component getTitle()

Could add a convenience method for a string title which wraps the text in a Div():

public void setTitle(String title)
// What about the getter?

Subtitle

public void setSubtitle(Component subtitle)
public Component getSubtitle()

Same as with the title slot, could add a convenience method for a string subtitle.

Header

public void setHeader(Component header)
public Component getHeader()

Header Prefix

public void setHeaderPrefix(Component headerPrefix)
public Component getHeaderPrefix()

Header Suffix

public void setHeaderSuffix(Component headerSuffix)
public Component getHeaderSuffix()

Footer

public void addToFooter(Component... footer)
public Component[] getFooterComponents() // Unsure if this is correct

Describe alternatives you've considered

No response

Additional context

No response

@samie
Copy link
Member

samie commented Jan 9, 2025

More discussion about the topic at https://vaadin.com/forum/t/card-component/167926

@yuriy-fix yuriy-fix added enhancement New feature or request component labels Jan 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants