Skip to main content

Terra UI Components

Intro

Forking the Repo

Start by forking the repo on GitHub, then clone it locally and install dependencies.

git clone https://github.com/YOUR_GITHUB_USERNAME/components terra-ui-components
cd terra-ui-components
npm install

Developing

Once you've cloned the repo, run the following command.

npm start

This will spin up the dev server. After the initial build, a browser will open automatically. There is currently no hot module reloading (HMR), as browser's don't provide a way to reregister custom elements, but most changes to the source will reload the browser automatically.

Building

To generate a production build, run the following commands.

npm run build # to build the Lit components

Creating New Components

To scaffold a new component, run the following command, replacing terra-tag-name with the desired tag name.

npm run create terra-tag-name

This will generate source files, a stylesheet, a Jupyter widget, and a docs page for you. When you start the dev server, you'll find the new component in the "Components" section of the sidebar. Do a git status to see all the changes this command made.

Testing Components in Jupyter Lab

Install the uv package manager (https://github.com/astral-sh/uv), it's a lightweight tool that makes working with virtual environments and packages much easier.

Then run the following:

  • uv venv - create a virtual environment (only have to do this the first time)
  • source .venv/bin/activate - activate it
  • uv pip install -e ".[dev]" - install dependencies (see pyproject.toml)
  • open base.py and point dependencies to localhost (do not commit these changes) TODO: fix this so we auto-detect local development
  • npm run start:python - spins up Jupyter lab and should open the browser for you

For an example of how to use the components in a Jupyter Notebook, open the /notebooks/playground.ipynb notebook in Jupyter Lab.

Publishing to NPM and PyPI

The Lit components are available on NPM at: https://www.npmjs.com/package/@nasa-terra/components The Python widgets are available on PyPI: https://pypi.org/project/terra_ui_components/

To build a new version and publish it, you can use NPM commands. The Python equivalents will be run automatically for you (see the "scripts" in package.json for details). You will need access to both repositories in order to publish.

# commit all your changes first
npm version patch # bump the version, you can use "major", "minor", "patch", etc.
npm publish --access=public

License

Terra UI Components were created by the NASA GES DISC team, on top of the amazing library Shoelace.

Shoelace was created by Cory LaViska and is available under the terms of the MIT license.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

terra_ui_components-0.0.194.tar.gz (4.5 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

terra_ui_components-0.0.194-py3-none-any.whl (30.4 kB view details)

Uploaded Python 3

File details

Details for the file terra_ui_components-0.0.194.tar.gz.

File metadata

  • Download URL: terra_ui_components-0.0.194.tar.gz
  • Upload date:
  • Size: 4.5 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-httpx/0.28.1

File hashes

Hashes for terra_ui_components-0.0.194.tar.gz
Algorithm Hash digest
SHA256 6eff11611e0dd7331ad55a54827d5e96b42f845da58377a1ad815a0a72093461
MD5 545d57da4d60c789d6fd0940583f20d4
BLAKE2b-256 4c1c4894a67209715afec3b3912caf138d25ffd226c30f04269dfa493c833b6f

See more details on using hashes here.

File details

Details for the file terra_ui_components-0.0.194-py3-none-any.whl.

File metadata

File hashes

Hashes for terra_ui_components-0.0.194-py3-none-any.whl
Algorithm Hash digest
SHA256 471e91cd3ec4f325132fc2099a981433395724e5c8bc976e399ba64a2945b474
MD5 dec3f60fab111119b40f0f1a7680cf62
BLAKE2b-256 f569ab69cbae894f71363d773bcdd98b62c0c4a4637826b4f1a7962798058de4

See more details on using hashes here.

Release history Release notifications | RSS feed

0.0.195

2 files

This release

0.0.194 This release

2 files

0.0.193

2 files

0.0.192

2 files

0.0.191

2 files

0.0.190

2 files

0.0.188

2 files

0.0.187

2 files

0.0.186

2 files

0.0.185

2 files

0.0.184

2 files

0.0.183

2 files

0.0.182

2 files

0.0.181

2 files

0.0.180

2 files

0.0.178

2 files

0.0.177

2 files

0.0.175

2 files

0.0.174

2 files

0.0.173

2 files

0.0.172

2 files

0.0.171

2 files

0.0.170

2 files

0.0.169

2 files

0.0.168

2 files

0.0.167

2 files

0.0.166

2 files

0.0.165

2 files

0.0.164

2 files

0.0.163

2 files

0.0.162

2 files

0.0.161

2 files

0.0.160

2 files

0.0.159

2 files

0.0.158

2 files

0.0.157

2 files

0.0.156

2 files

0.0.154

2 files

0.0.153

2 files

0.0.152

2 files

0.0.151

2 files

0.0.150

2 files

0.0.149

2 files

0.0.148

2 files

0.0.147

2 files

0.0.146

2 files

0.0.145

2 files

0.0.144

2 files

0.0.142

2 files

0.0.141

2 files

0.0.140

2 files

0.0.139

2 files

0.0.138

2 files

0.0.137

2 files

0.0.136

2 files

0.0.135

2 files

0.0.134

2 files

0.0.133

2 files

0.0.131

2 files

0.0.130

2 files

0.0.129

2 files

0.0.128

2 files

0.0.127

2 files

0.0.126

2 files

0.0.125

2 files

0.0.124

2 files

0.0.123

2 files

0.0.122

2 files

0.0.121

2 files

0.0.120

2 files

0.0.119

2 files

0.0.118

2 files

0.0.117

2 files

0.0.116

2 files

0.0.115

2 files

0.0.114

2 files

0.0.113

2 files

0.0.112

2 files

0.0.111

2 files

0.0.110

2 files

0.0.103

2 files

0.0.102

2 files

0.0.101

2 files

0.0.100

2 files

0.0.99

2 files

0.0.98

2 files

0.0.97

2 files

0.0.96

2 files

0.0.94

2 files

0.0.87

2 files

0.0.83

2 files

0.0.82

2 files

0.0.81

2 files

0.0.80

2 files

0.0.79

2 files

0.0.77

2 files

0.0.76

2 files

0.0.75

2 files

0.0.74

2 files

0.0.73

2 files

0.0.72

2 files

0.0.71

2 files

0.0.70

2 files

0.0.69

2 files

0.0.68

2 files

0.0.67

2 files

0.0.66

2 files

0.0.65

2 files

0.0.64

2 files

0.0.63

2 files

0.0.62

2 files

0.0.60

2 files

0.0.59

2 files

0.0.58

2 files

0.0.57

2 files

0.0.54

2 files

0.0.53

2 files

0.0.52

2 files

0.0.51

2 files

0.0.50

2 files

0.0.49

2 files

0.0.48

2 files

0.0.47

2 files

0.0.46

2 files

0.0.45

2 files

0.0.44

2 files

0.0.43

2 files

0.0.42

2 files

0.0.41

2 files

0.0.40

2 files

0.0.39

2 files

0.0.37

2 files

0.0.36

2 files

0.0.35

2 files

0.0.34

2 files

0.0.33

2 files

0.0.32

2 files

0.0.31

2 files

0.0.30

2 files

0.0.29

2 files

0.0.28

2 files

0.0.27

2 files

0.0.26

2 files

0.0.23

2 files

0.0.22

2 files

0.0.21

2 files

0.0.20

2 files

0.0.19

2 files

0.0.17

2 files

0.0.16

2 files

0.0.15

2 files

0.0.14

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page