{"id":15376710,"url":"https://github.com/bennypowers/card","last_synced_at":"2025-04-15T16:52:04.824Z","repository":{"id":57137797,"uuid":"300550250","full_name":"bennypowers/card","owner":"bennypowers","description":"Simple card custom element with header and actions","archived":false,"fork":false,"pushed_at":"2020-11-11T07:19:23.000Z","size":175,"stargazers_count":3,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-11T20:09:17.015Z","etag":null,"topics":["card","customelements","hacktoberfest","html","webcomponents"],"latest_commit_sha":null,"homepage":"https://codepen.io/bennyp/pen/OJdpPeZ","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bennypowers.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-10-02T08:27:44.000Z","updated_at":"2023-11-07T20:45:02.000Z","dependencies_parsed_at":"2022-09-01T03:01:22.784Z","dependency_job_id":null,"html_url":"https://github.com/bennypowers/card","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bennypowers%2Fcard","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bennypowers%2Fcard/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bennypowers%2Fcard/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bennypowers%2Fcard/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bennypowers","download_url":"https://codeload.github.com/bennypowers/card/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249114073,"owners_count":21215013,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["card","customelements","hacktoberfest","html","webcomponents"],"created_at":"2024-10-01T14:08:43.860Z","updated_at":"2025-04-15T16:52:04.796Z","avatar_url":"https://github.com/bennypowers.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# p-card\n\n## Example\n\n```html\n\u003cp-card\u003e\n  \u003ch2 slot=\"heading\"\u003eA card!\u003c/h2\u003e\n  \u003cp\u003eHas any content you want\u003c/p\u003e\n  \u003cbutton slot=\"actions\"\u003eAs well as action buttons\u003c/button\u003e\n\u003c/p-card\u003e\n```\n\n## Properties\n\n| Property      | Type      | Description                                      |\n|---------------|-----------|--------------------------------------------------|\n| `collapsed`   | `boolean` | If the card is collapsible, whether or not it is collapsed |\n| `collapsible` | `boolean` | Whether or not the card is collapsible           |\n| `elevation`   | `number`  | Card's elevation in the DOM tree                 |\n\n## Methods\n\n| Method            | Type       | Description                         |\n|-------------------|------------|-------------------------------------|\n| `toggleCollapsed` | `(): void` | Toggles the card's collapsed state. |\n\n## Slots\n\n| Name      | Description                                      |\n|-----------|--------------------------------------------------|\n|           | Content Slot.                                    |\n| `actions` | Actions Footer. Use a `\u003cmenu\u003e`                   |\n| `heading` | Heading. Use an `\u003chgroup\u003e` or `\u003ch1\u003e`, `\u003ch2\u003e`, etc. |\n\n## CSS Shadow Parts\n\n| Part      | Description       |\n|-----------|-------------------|\n| `actions` | Actions container |\n| `content` | Content container |\n| `heading` | Heading container |\n\n## CSS Custom Properties\n\n| Property                            | Default                                          | Description                        |\n|-------------------------------------|--------------------------------------------------|------------------------------------|\n| `--elevation`                       | 1                                                | elevation coefficient              |\n| `--p-card-background-elevation1`    | \"#1111\"                                          | background for 1st elevation cards |\n| `--p-card-background-elevation2`    | \"#2222\"                                          | background for 2nd elevation cards |\n| `--p-card-border-radius`            | \"var(--p-card-border-radius-root, 16px) / var(--elevation, 1)\" |                                    |\n| `--p-card-border-radius-root`       | \"16px\"                                           | border-radius                      |\n| `--p-card-card-border`              |                                                  | border                             |\n| `--p-card-divider`                  | \"var(--p-card-background-elevation1)\"            | color of heading divider           |\n| `--p-card-drop-shadow`              | \"0 3px 1px -2px rgba(0, 0, 0, 0.2), 0 2px 2px 0 rgba(0, 0, 0, 0.14), 0 1px 5px 0 rgba(0, 0, 0, 0.12)\" | box-shadow                         |\n| `--p-card-heading-background-color` | \"initial\"                                        |                                    |\n\n\n# p-card\n\n## Example\n\n```html\n\u003cp-card\u003e\n  \u003ch2 slot=\"heading\"\u003eA card!\u003c/h2\u003e\n  \u003cp\u003eHas any content you want\u003c/p\u003e\n  \u003cbutton slot=\"actions\"\u003eAs well as action buttons\u003c/button\u003e\n\u003c/p-card\u003e\n```\n\n## Properties\n\n| Property          | Attribute     | Type      | Default | Description                                      |\n|-------------------|---------------|-----------|---------|--------------------------------------------------|\n| `collapsed`       | `collapsed`   | `boolean` | false   | If the card is collapsible, whether or not it is collapsed |\n| `collapsible`     | `collapsible` | `boolean` | false   | Whether or not the card is collapsible           |\n| `elevation`       | `elevation`   | `number`  |         | Card's elevation in the DOM tree                 |\n| `onMutate`        |               |           |         |                                                  |\n| `toggleCollapsed` |               |           |         |                                                  |\n\n## Methods\n\n| Method            | Type       | Description                         |\n|-------------------|------------|-------------------------------------|\n| `toggleCollapsed` | `(): void` | Toggles the card's collapsed state. |\n\n## Slots\n\n| Name      | Description                                      |\n|-----------|--------------------------------------------------|\n|           | Content Slot.                                    |\n| `actions` | Actions Footer. Use a `\u003cmenu\u003e`                   |\n| `heading` | Heading. Use an `\u003chgroup\u003e` or `\u003ch1\u003e`, `\u003ch2\u003e`, etc. |\n\n## CSS Shadow Parts\n\n| Part      | Description       |\n|-----------|-------------------|\n| `actions` | Actions container |\n| `content` | Content container |\n| `heading` | Heading container |\n\n## CSS Custom Properties\n\n| Property                            | Default                                          | Description                        |\n|-------------------------------------|--------------------------------------------------|------------------------------------|\n| `--elevation`                       | 1                                                | elevation coefficient              |\n| `--p-card-background-elevation1`    | \"#1111\"                                          | background for 1st elevation cards |\n| `--p-card-background-elevation2`    | \"#2222\"                                          | background for 2nd elevation cards |\n| `--p-card-border-radius`            | \"var(--p-card-border-radius-root, 16px) / var(--elevation, 1)\" |                                    |\n| `--p-card-border-radius-root`       | \"16px\"                                           | border-radius                      |\n| `--p-card-card-border`              |                                                  | border                             |\n| `--p-card-divider`                  | \"var(--p-card-background-elevation1)\"            | color of heading divider           |\n| `--p-card-drop-shadow`              | \"0 3px 1px -2px rgba(0, 0, 0, 0.2), 0 2px 2px 0 rgba(0, 0, 0, 0.14), 0 1px 5px 0 rgba(0, 0, 0, 0.12)\" | box-shadow                         |\n| `--p-card-heading-background-color` | \"initial\"                                        |                                    |\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbennypowers%2Fcard","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbennypowers%2Fcard","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbennypowers%2Fcard/lists"}