Comments (10)
@tobias-mintlify is this a duplicate of #57
from components.
Reopening, this is a separate issue to allow an image as an icon. This issue is super small and is only about updating the type definition of the component.
#57 is about allowing a big image at the top of the card.
from components.
@tobias-mintlify correct me if I'm wrong. In this updation the icon will accept a href of an image. And the card component will conditionally check is it a image(string) or a svg, right, and based of the condition it will render img and svg respectively.
from components.
Yes exactly. String input gets passed to the image src
property. SVGs will still be passed as components.
from components.
Then excited to contribute. Assign me, I will give it a try 😸
from components.
Is it looking good? or it need some modification. If so mention please.
from components.
How can I update this so that icon prop accepts a string as well ??
from components.
That's looking good. If you update the type definition of the component Storybook should automatically start accepting strings too. You can try something like icon?: string | ReactNode
.
from components.
That's looking good. If you update the type definition of the component Storybook should automatically start accepting strings too. You can try something like
icon?: string | ReactNode
.
This is happening although I specified string | ReactNode
Possible reason is ReactNode has string property as literal type
from components.
Its working if we pass a JSON string
from components.
Related Issues (18)
- Show "Click to Copy" tooltip when you hover over the clipboard of a code block HOT 1
- Default CodeGroup to a dropdown when file names exceed width of the container
- Cannot type a negative sign in numerical inputs for the API Playground
- Add aria labels to clipboard button in CodeGroups HOT 2
- Copy tooltip shows up behind navigation bar HOT 11
- Combine copiedTooltipColor and tooltipColor HOT 2
- Callback when clipboard is clicked on code blocks HOT 4
- Make components to show images side by side HOT 3
- Cards should accept an image prop HOT 5
- GraphQL playground HOT 2
- Tree-shaking HOT 14
- Add background color on card components HOT 1
- Add precommit formatting hook to the components repo HOT 1
- Upgrade to Storybook 7
- Make a ColorFrame component HOT 2
- Mermaid.js component HOT 3
- Support Global Sync for `<Tabs>` Components
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from components.