# Animated Globe

Render an interactive 3D globe in React with the Cobe library. Preview its rotation and customize the globe for your layout.

[Read on UI Layouts](https://www.ui-layouts.com/components/globe)

> To Get the sparkle code Please Click That Link [here](https://www.ui-layouts.com/components/sparkles)

Example: `card-globe-default`

## Installation

```bash
npx uilayouts@latest add globe
```

```bash
npx shadcn@latest add 'https://www.ui-layouts.com/r/globe.json'
```

```bash
npm install cobe
```

[globe registry source](https://www.ui-layouts.com/r/globe.json)

## Props

| Prop          | Type                      | Default                  | Description                                                |
| ------------- | ------------------------- | ------------------------ | ---------------------------------------------------------- |
| className     | string                    | undefined                | Optional CSS class for styling the Earth component.        |
| theta         | number                    | 0.25                     | Controls the rotational angle of the Earth.                |
| dark          | number                    | 1                        | Controls the darkness level of the Earth.                  |
| scale         | number                    | 1.1                      | Controls the scaling factor of the Earth.                  |
| diffuse       | number                    | 1.2                      | Controls the diffuse light intensity of the Earth.         |
| mapSamples    | number                    | 40000                    | The number of samples used for the map texture.            |
| mapBrightness | number                    | 6                        | The brightness of the map texture.                         |
| baseColor     | \[number, number, number] | \[0.4, 0.6509, 1]        | The base color of the Earth as an RGB array.               |
| markerColor   | \[number, number, number] | \[1, 0, 0]               | The color of the markers on the Earth as an RGB array.     |
| glowColor     | \[number, number, number] | \[0.2745, 0.5765, 0.898] | The color of the glow effect on the Earth as an RGB array. |

## Example

### Light Globe

Example: `card-globe-white` · [card-globe-white registry source](https://www.ui-layouts.com/r/card-globe-white.json)

### Sparkles Globe

Example: `sparkles-globe` · [sparkles-globe registry source](https://www.ui-layouts.com/r/sparkles-globe.json)

```tsx
import React from 'react';
import { Sparkles } from '@/components/ui/sparkles';
import Earth from '@/components/ui/globe';

function index() {
  return (
    <>
      <div className='h-screen overflow-hidden bg-black text-white'>
        <article className='grid gap-4 text-center relative z-10 pt-10'>
          <span className='inline-block text-sm border p-1 px-3 w-fit mx-auto rounded-full border-[#3273ff] bg-[#0f1c35]'>
            Get Access
          </span>
          <h1 className='text-4xl  font-semibold bg-linear-to-b from-[#edeffd] to-[#7b9cda] bg-clip-text text-transparent leading-[100%] tracking-tighter'>
            Design with a Global
            <br />
            Perspective, Innovate with Ease.
          </h1>
          <Earth />
        </article>

        <div className='relative -mt-32 h-80 w-screen overflow-hidden mask-[radial-gradient(50%_50%,white,transparent)] before:absolute before:inset-0 before:bg-[radial-gradient(circle_at_bottom_center,#3273ff,transparent_90%)] before:opacity-40 after:absolute after:-left-1/2 after:top-1/2 after:aspect-[1/0.7] after:w-[200%] after:rounded-[10%] after:border-t after:border-[#163474] after:bg-[#08132b]'>
          <SparklesGblobe
            density={1200}
            className='absolute inset-x-0 bottom-0 h-full w-full '
          />
        </div>
      </div>
    </>
  );
}

export default index;
```

> To Get the sparkle code Please Click That Link [here](https://www.ui-layouts.com/components/sparkles)
