question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Provide helper (or an example in docs) of interactive Card component

See original GitHub issue

Material Design defines that card can be interactable (button like). This is how the first example of MCW Card component behaves.

This is currently perfectly do-able with ButtonBase, as I answered in this SO question.

I also updated the CodeSandbox example with a new one to include overflow:hidden on the Card so that the button top corners are rounded. In the library this shouldn’t happen since that will cause breaking clipping issues, so this is something to solve somehow.

My proposal is to either

  • introduce a new component, such as CardActionableContent (bad name, I know) or
  • a button prop to CardContent.

Having even just an example would help, but it requires some styles to be applied to the card and this looks like a common enough case to be covered by the APIs.

  • I have searched the issues of this repository and believe that this is not a duplicate.

Sorry if I removed the rest of the parts of the issue template, they didn’t apply here since it is more of a feature request.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:23 (22 by maintainers)

github_iconTop GitHub Comments

2reactions
yuchicommented, May 3, 2018

Now that I re-read the thread I’m totally into CardActionArea and CardActions.

1reaction
yuchicommented, Apr 12, 2018

I fear the whole Card component is off the spec. For example CardContent has inline-sides padding of 3 units (≈24px) while this nowhere to be found in the spec.

Edit: Sorry, I missed the discussion in #10044. I still believe CardContent/Action components shouldn’t have variable gutters. They always are 16px in the .ai templates they provide.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Cards - Bootstrap
A card is a flexible and extensible content container. It includes options for headers and footers, a wide variety of content, contextual background...
Read more >
Send a card message | Google Chat
Cards support a defined layout, interactive UI elements like buttons, ... In this example, a user sends the Chat app a message in...
Read more >
Card component — Vuetify
The card component has numerous helper components to make markup as easy as ... Try out an interactive screencast on how Vuetify cards...
Read more >
Google Docs Beginner Tutorial - YouTube
Google Docs Beginner TutorialExercise Files: https://bit.ly/3vLqpItWho it's for: This course is designed for anyone who needs a free, ...
Read more >
React Card component - Material UI - MUI
Although cards can support multiple actions, UI controls, and an overflow menu, use restraint and remember that cards are entry points to more...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found