{"id":15862169,"url":"https://github.com/afeiship/react-details","last_synced_at":"2026-04-29T10:03:52.010Z","repository":{"id":57122968,"uuid":"293465317","full_name":"afeiship/react-details","owner":"afeiship","description":"Details for react.","archived":false,"fork":false,"pushed_at":"2021-02-14T15:34:17.000Z","size":281,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-06-03T20:02:19.224Z","etag":null,"topics":["collapse","details","react","summary","toggle"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/afeiship.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-09-07T08:18:44.000Z","updated_at":"2021-02-14T15:34:19.000Z","dependencies_parsed_at":"2022-08-26T05:50:53.388Z","dependency_job_id":null,"html_url":"https://github.com/afeiship/react-details","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/afeiship%2Freact-details","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/afeiship%2Freact-details/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/afeiship%2Freact-details/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/afeiship%2Freact-details/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/afeiship","download_url":"https://codeload.github.com/afeiship/react-details/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/afeiship%2Freact-details/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259009995,"owners_count":22792107,"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":["collapse","details","react","summary","toggle"],"created_at":"2024-10-05T22:25:24.205Z","updated_at":"2026-04-29T10:03:51.936Z","avatar_url":"https://github.com/afeiship.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# react-details\n\u003e Details for react.\n\n[![version][version-image]][version-url]\n[![license][license-image]][license-url]\n[![size][size-image]][size-url]\n[![download][download-image]][download-url]\n\n## installation\n```shell\nnpm install -S @jswork/react-details\n```\n\n## properties\n| Name      | Type   | Required | Default | Description                                                          |\n| --------- | ------ | -------- | ------- | -------------------------------------------------------------------- |\n| className | string | false    | -       | The extended className for component.                                |\n| value     | bool   | false    | -       | The changed value.                                                   |\n| onChange  | func   | false    | noop    | The change handler.                                                  |\n| summary   | any    | false    | -       | The summary content.                                                 |\n| disabled  | bool   | false    | -       | When present, it specifies that the details should be disabled.      |\n| arrow     | bool   | false    | true    | When present, it specifies that the summary arrow should be display. |\n\n\n## usage\n1. import css\n  ```scss\n  @import \"~@jswork/react-details/dist/style.css\";\n\n  // or use sass\n  @import \"~@jswork/react-details/dist/style.scss\";\n\n  // customize your styles:\n  $react-details-options: ()\n  ```\n2. import js\n  ```js\n  import ReactDemokit from '@jswork/react-demokit';\n  import React from 'react';\n  import ReactDOM from 'react-dom';\n  import ReactDetails from '@jswork/react-details';\n  import './assets/style.scss';\n\n  class App extends React.Component {\n    state = { value: true };\n\n    render() {\n      return (\n        \u003cReactDemokit\n          className=\"p-3 app-container\"\n          url=\"https://github.com/afeiship/react-details\"\u003e\n          \u003cp className=\"p-3 bg-gray-200 mb-2\"\u003evalue: {this.state.value + ''}\u003c/p\u003e\n          \u003cReactDetails\n            value={true}\n            arrow={false}\n            summary=\"道可道，非常道\"\n            onChange={(e) =\u003e {\n              this.setState({ value: e.target.value });\n            }}\u003e\n            道可道，非常道；名可名，非常名。 无名，天地之始，有名，万物之母。\n            故常无欲，以观其妙，常有欲，以观其徼。\n            此两者，同出而异名，同谓之玄，玄之又玄，众妙之门。\n          \u003c/ReactDetails\u003e\n        \u003c/ReactDemokit\u003e\n      );\n    }\n  }\n\n  ReactDOM.render(\u003cApp /\u003e, document.getElementById('app'));\n\n  ```\n\n## animation\n```css\n/* remove arrow */\n\u0026::-webkit-details-marker {\n  // display: none;\n}\n\n\n/* add animation */\n\u0026[open] summary ~ * {\n  animation: open 0.5s ease-in-out;\n}\n\n@keyframes open {\n  0% {\n    opacity: 0;\n    margin-left: -5px;\n  }\n  100% {\n    opacity: 1;\n    margin-left: 0px;\n  }\n}\n```\n\n## documentation\n- https://afeiship.github.io/react-details/\n\n\n## license\nCode released under [the MIT license](https://github.com/afeiship/react-details/blob/master/LICENSE.txt).\n\n[version-image]: https://img.shields.io/npm/v/@jswork/react-details\n[version-url]: https://npmjs.org/package/@jswork/react-details\n\n[license-image]: https://img.shields.io/npm/l/@jswork/react-details\n[license-url]: https://github.com/afeiship/react-details/blob/master/LICENSE.txt\n\n[size-image]: https://img.shields.io/bundlephobia/minzip/@jswork/react-details\n[size-url]: https://github.com/afeiship/react-details/blob/master/dist/react-details.min.js\n\n[download-image]: https://img.shields.io/npm/dm/@jswork/react-details\n[download-url]: https://www.npmjs.com/package/@jswork/react-details\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fafeiship%2Freact-details","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fafeiship%2Freact-details","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fafeiship%2Freact-details/lists"}