{"id":22403370,"url":"https://github.com/springload/pattern-library","last_synced_at":"2026-05-02T09:32:51.989Z","repository":{"id":66138689,"uuid":"54532219","full_name":"springload/pattern-library","owner":"springload","description":"WIP: Pattern library in django. ","archived":false,"fork":false,"pushed_at":"2018-10-23T03:24:35.000Z","size":117,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":21,"default_branch":"master","last_synced_at":"2025-02-01T06:25:42.284Z","etag":null,"topics":["django","pattern-library"],"latest_commit_sha":null,"homepage":null,"language":"Python","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/springload.png","metadata":{"files":{"readme":"README-OLD.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-03-23T05:01:41.000Z","updated_at":"2018-10-23T03:24:36.000Z","dependencies_parsed_at":null,"dependency_job_id":"8001a78c-c04f-4379-9710-d66632741c9e","html_url":"https://github.com/springload/pattern-library","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/springload%2Fpattern-library","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/springload%2Fpattern-library/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/springload%2Fpattern-library/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/springload%2Fpattern-library/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/springload","download_url":"https://codeload.github.com/springload/pattern-library/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245760935,"owners_count":20667893,"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":["django","pattern-library"],"created_at":"2024-12-05T09:16:56.662Z","updated_at":"2026-05-02T09:32:51.953Z","avatar_url":"https://github.com/springload.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n### Pattern Library\n\nThis is some _very_ initial thinking about how a pattern library could work.\n\nThe pattern library has two simple goals: \n\n\n* Reduce boilerplate and repetition between projects.\n* Provide documentation about the interface/frontend. This helps when new people pick up the project. They can see what it is made of.\n\n### What lives in the pattern library?\n\n* Forms!\n - Fields\n - Field errors/validation\n - Message\n - Variations on forms: inline fields, stacked fields, etc...\n* Things that are used on at least 2 (preferably 3) production projects. Components we *know* we will re-use. \n\n### Naming conventions.\n  - Naming is hard.\n  - Where possible, use the accessible component name/role\n    - FED team to read the boring spec and come up with a few good names.\n  - Use names from material or WIA or bootstrap.\n  - Do a naming session on all UI projects. Should include the DES + FED + DEV + AM.\n  - Meet occasionally and check SL are naming components properly.\n\n--- \n\n## Installation\n\n1. Check out the project.\n2. Run `pip install -r requirements.txt` in the project root.\n\n## Starting the server\n\n`./manage.py runserver`\n\n## View it on\n`http://localhost:8000`\n\n### Creating new components\nUse `./manage.py createcomponent my_app my_component` to scafold the basic structure under `my_app/components/`\n\n---\n\n## Installing into an existing Django Project\n\nIn `PROJECT/settings.py`:\n - Add `patterns` to `INSTALLED_APP`\n - Add `os.path.join(BASE_DIR, 'patterns', 'components')` to `TEMPLATES['DIRS']`\n\n## Syntax\n\nYou load some data and pass it to a component.\n\nThis could be stored in a Python package:\n\n```\n{% component \"button\" data='example.conf.DEFAULT_BUTTON' %}\n```\n\nOr, set dynamically in the template:\n\n```twig\n{% options button_data %}\n  {\n    \"class\": [\n      \"btn\",\n      \"btn-primary\",\n      \"btn-options\"\n    ],\n    \"attrs\": {\n        \"data-button\": \"some-value\"\n    },\n    \"label\": \"{{ 'I changed the label' }}\"\n  }\n{% endoptions %}\n{% component \"button\" data=button_data %}\n```\n\nOr both:\n\n\n```twig\n{% load_data \"example.data.BUTTON_DATA\" as common_data %}\n{% options common_data button_data %}\n  {\n    \"label\": \"{{ 'I changed the label' }}\"\n  }\n{% endoptions %}\n{% component \"button\" data=button_data  %}\n```\n\n## Custom components\n\n### Setup your  app\n1. Create a new application `./manage.py startapp my_app`\n1. Update `PROJECT/settings.py`:\n  - Add `my_app` to `INSTALLED_APP` **before** `patterns`\n  - Add `os.path.join(BASE_DIR, 'my__app', 'components')` to `TEMPLATES['DIRS']` **before** `os.path.join(BASE_DIR, 'patterns', 'components')`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fspringload%2Fpattern-library","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fspringload%2Fpattern-library","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fspringload%2Fpattern-library/lists"}