Skip to content
Source
Sign inSign up
TanStack/router
Open History to see the last commit

index.js

365 lines15.4 KB

1import * as React from 'react'
2import { Banner } from 'components/Banner'
3import { Sticky } from 'components/Sticky'
4import { Nav } from 'components/Nav'
5import { siteConfig } from 'siteConfig'
6import Link from 'next/link'
7import { Footer } from 'components/Footer'
8import { Seo } from 'components/Seo'
9import Head from 'next/head'
10import { ParentSize } from '@visx/responsive'
11​
12const Home = (props) => {
13 return (
14 <>
15 <Seo
16 title="React Location"
17 description="Enterprise routing for React applications"
18 />
19 <Head>
20 <title>
21 React Location - Enterprise routing for React applications
22 </title>
23 </Head>
24 <div className="bg-gray-50 h-full min-h-full">
25 <Banner />
26 <Sticky>
27 <Nav />
28 </Sticky>
29 <div
30 style={{
31 padding: '56.25% 0 0 0',
32 position: 'relative',
33 }}
34 >
35 <iframe
36 width="560"
37 height="315"
38 src="https://www.youtube.com/embed/rLY65AQreSU"
39 title="YouTube video player"
40 frameborder="0"
41 allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"
42 allowfullscreen
43 style={{
44 position: 'absolute',
45 top: 0,
46 left: 0,
47 width: '100%',
48 height: '100%',
49 }}
50 ></iframe>
51 </div>
52 <div className="relative bg-white overflow-hidden shadow-2xl">
53 <div className="py-24 mx-auto container px-4 sm:mt-12 relative">
54 <img
55 src={require('images/emblem-light.svg')}
56 className="absolute transform right-0 top-1/2 h-0 lg:h-full scale-150 translate-x-1/2 xl:translate-x-1/5 -translate-y-1/2"
57 alt="React Location Emblem"
58 />
59 <div className="grid grid-cols-12 gap-8">
60 <div className="col-span-12 lg:col-span-6 ">
61 <div className="text-center lg:text-left md:max-w-2xl md:mx-auto ">
62 <h1 className="text-4xl tracking-tight leading-10 font-extrabold text-gray-900 sm:leading-none sm:text-6xl lg:text-5xl xl:text-6xl">
63 Powerful, enterprise-grade routing for React applications
64 </h1>
65 <p className="mt-3 text-base text-gray-700 sm:mt-5 sm:text-xl lg:text-lg xl:text-xl">
66 Declarative & asynchronous route elements and data loaders,
67 first-class Search Param APIs, nested-routing,
68 code-splitting and so much more.
69 </p>
70​
71 <div className="mt-5 mx-auto sm:flex sm:justify-center lg:justify-start lg:mx-0 md:mt-8">
72 <div className="rounded-md shadow">
73 <Link href="/overview">
74 <a className="w-full flex items-center justify-center px-8 py-3 border border-transparent text-base leading-6 font-medium rounded-md text-white bg-coral hover:bg-coral-light focus:outline-none focus:border-coral focus:shadow-outline-coral transition duration-150 ease-in-out md:py-4 md:text-lg md:px-10">
75 Get Started
76 </a>
77 </Link>
78 </div>
79 <div className="mt-3 rounded-md shadow sm:mt-0 sm:ml-3">
80 <a
81 href={siteConfig.repoUrl}
82 target="_blank"
83 rel="noopener noreferrer"
84 className="w-full flex items-center justify-center px-8 py-3 border border-transparent text-base leading-6 font-medium rounded-md text-coral bg-white hover:text-coral-light focus:outline-none focus:border-coral-light focus:shadow-outline-coral transition duration-150 ease-in-out md:py-4 md:text-lg md:px-10"
85 >
86 GitHub
87 </a>
88 </div>
89 </div>
90 </div>
91 </div>
92 </div>
93 </div>
94 </div>
95 <div className="text-lg border-t border-gray-200 bg-gray-50 ">
96 <div className="py-24 ">
97 <div className="mx-auto container">
98 <div className="lg:grid lg:grid-cols-3 lg:gap-8">
99 <div>
100 <h3 className="text-xl leading-6 xl:text-2xl font-bold text-gray-900">
101 Table Stakes, but Without the Table
102 </h3>
103 <p className="mt-2 lg:mt-4 text-base xl:text-lg lg:leading-normal leading-6 text-gray-600">
104 While React Location pays serious homage to features that
105 users have come to expect from existing routers in the
106 ecosystem like React Router and Next.js, it's not wasting
107 any time by ignoring the complexities and challenges of
108 building client-side applications. React Location is
109 hyper-focused on providing mega-smooth routing experiences
110 that your users will immediately fall in love with.
111 </p>
112 </div>
113 <div className="mt-10 lg:mt-0">
114 <h3 className="text-xl leading-6 xl:text-2xl font-bold text-gray-900">
115 Asynchronous Routing, Prefetching & Caching
116 </h3>
117 <p className="mt-2 lg:mt-4 text-base xl:text-lg lg:leading-normal leading-6 text-gray-600">
118 Async routing has easily become the standard for full-stack
119 react frameworks but where traditional SPA routing is
120 falling behind, React Location packs a new modern punch.
121 SSR-style async routing is the out-of-the-box default
122 providing parallelized component-splitting and data-loading
123 with minimal effort.
124 </p>
125 </div>
126 <div className="mt-10 lg:mt-0">
127 <h3 className="text-xl leading-6 xl:text-2xl font-bold text-gray-900">
128 First-Class Search Params API
129 </h3>
130 <div className="mt-2 lg:mt-4 text-base xl:text-lg lg:leading-normal leading-6 text-gray-600">
131 Where most other routers provide minimum-to-no support for
132 intelligent URL search param management, React Location
133 takes them very seriously to provide highly integrated
134 support for matching, consuming, and manipulating URL search
135 params at scale.
136 </div>
137 </div>
138 </div>
139 </div>
140 </div>
141 {/* <div className="py-6">
142 <div className="uppercase tracking-wider text-sm font-semibold text-center text-gray-400 mb-3">
143 Trusted in Production by
144 </div>
145​
146 <ClientsMarquee />
147 </div> */}
148 </div>
149 <div className="relative text-lg border-t border-gray-200 bg-gray-100 overflow-hidden">
150 <div className="lg:block lg:absolute lg:inset-0">
151 <svg
152 className="absolute top-1/2 left-1/2 transform -translate-y-1/2 -translate-x-1/2"
153 width="2400"
154 height="2400"
155 fill="none"
156 viewBox="0 0 2400 2400"
157 >
158 <defs>
159 <pattern
160 id="9ebea6f4-a1f5-4d96-8c4e-4c2abf658047"
161 x="0"
162 y="0"
163 width="20"
164 height="20"
165 patternUnits="userSpaceOnUse"
166 >
167 <rect
168 x="0"
169 y="0"
170 width="4"
171 height="4"
172 className="text-gray-200"
173 fill="currentColor"
174 />
175 </pattern>
176 </defs>
177 <rect
178 x="0"
179 width="2400"
180 height="2400"
181 fill="url(#9ebea6f4-a1f5-4d96-8c4e-4c2abf658047)"
182 />
183 </svg>
184 </div>
185 <div className="relative">
186 <h3 className="text-center text-3xl leading-8 font-extrabold tracking-tight text-gray-900 sm:text-4xl sm:leading-10 lg:leading-none mt-8">
187 Sponsors
188 </h3>
189 <div
190 className="py-4 flex flex-wrap mx-auto"
191 style={{ maxWidth: '95%' }}
192 >
193 <ParentSize>
194 {({ width }) => {
195 return (
196 <iframe
197 title="sponsors"
198 src="https://tanstack.com/sponsors-embed"
199 style={{
200 width: width,
201 height: width,
202 overflow: 'hidden',
203 }}
204 />
205 )
206 }}
207 </ParentSize>
208 </div>
209 <div className="text-center mb-8">
210 <a
211 href="https://github.com/sponsors/tannerlinsley"
212 className="inline-block bg-green-500 px-4 py-2 text-xl mx-auto leading-tight font-extrabold tracking-tight text-white rounded-full"
213 >
214 Become a Sponsor!
215 </a>
216 </div>
217 </div>
218 </div>
219 <div className="bg-gray-100 relative py-24 border-t border-gray-200 ">
220 <div className="px-4 sm:px-6 lg:px-8 mx-auto container max-w-3xl sm:text-center">
221 <h3 className="text-3xl leading-8 font-extrabold tracking-tight text-gray-900 sm:text-4xl sm:leading-10 lg:leading-none mt-2">
222 Try out the "Kitchen Sink" example below!
223 </h3>
224 <p className="my-4 text-xl leading-7 text-gray-600">
225 Build your paths. Fetch your data. Command those URL Search
226 params! Render your routes... asynchronously of course!
227 </p>
228 </div>
229 <div
230 style={{
231 height: 224,
232 }}
233 />
234 </div>
235​
236 <section className="bg-gray-900 body-font">
237 <div className="container max-w-7xl px-4 mx-auto -mt-72 relative">
238 <iframe
239 src="https://codesandbox.io/embed/github/tanstack/react-location/tree/main/examples/kitchen-sink?autoresize=1&fontsize=16&theme=dark"
240 title="tanstack/react-location: simple"
241 sandbox="allow-forms allow-modals allow-popups allow-presentation allow-same-origin allow-scripts"
242 className="shadow-2xl"
243 style={{
244 width: '100%',
245 height: '80vh',
246 border: '0',
247 borderRadius: 8,
248 overflow: 'hidden',
249 position: 'static',
250 zIndex: 0,
251 }}
252 ></iframe>
253 </div>
254 <div className="py-24 px-4 sm:px-6 lg:px-8 mx-auto container">
255 <div className=" sm:text-center pb-16">
256 <h3 className="text-3xl mx-auto leading-tight font-extrabold tracking-tight text-white sm:text-4xl lg:leading-none mt-2">
257 A knob, toggle and function for everything!
258 </h3>
259 <p className="mt-4 text-xl max-w-3xl mx-auto leading-7 text-gray-300">
260 As any great primitive utility would, React Location is designed
261 to get out of your way when you need it to. Inversion of control
262 is our name, and control is your game.
263 </p>
264 </div>
265 <div>
266 <div className="grid grid-flow-row grid-cols-1 sm:grid-cols-2 md:grid-cols-3 gap-4 text-white max-w-screen-lg mx-auto text-lg">
267 {[
268 'Asynchronous Elements',
269 'Async Route Loaders',
270 'Code-Splitting',
271 'Nested/Layout Routes',
272 'Path Params',
273 '1st-Class Search Params API',
274 'Search Param Route Matching',
275 'Search Param Filters/Persistence',
276 'Search Param Compression + Stability',
277 'Default Elements',
278 'Error Boundary Elements',
279 'Pending Elements',
280 'Minimum Pending Duration',
281 ].map((d) => {
282 return (
283 <a className="mb-2" key={d}>
284 <span className="bg-coral text-gray-800 w-4 h-4 mr-2 rounded-full inline-flex items-center justify-center">
285 <Check />
286 </span>
287 {d}
288 </a>
289 )
290 })}
291 </div>
292 </div>
293 </div>
294 </section>
295 <div className="bg-gray-200 border-b border-gray-300">
296 <div className="container mx-auto py-12 text-center">
297 <h3 className="text-2xl md:text-5xl mx-auto leading-tight font-extrabold tracking-tight text-gray-800 lg:leading-none mt-2">
298 Feeling Chatty?
299 </h3>
300 <a
301 href="https://discord.gg/WrRKjPJ"
302 target="_blank"
303 className="inline-block bg-gray-800 p-5 text-2xl mx-auto leading-tight font-extrabold tracking-tight text-white mt-12 rounded-full"
304 >
305 Join the #TanStack Discord!
306 </a>
307 </div>
308 </div>
309 <div className="bg-gray-50 border-b border-gray-100">
310 <div className="container mx-auto py-24 px-4 flex flex-wrap md:flex-no-wrap items-center justify-between md:space-x-8">
311 <h2 className="text-3xl leading-9 font-extrabold tracking-tight text-gray-900 sm:text-4xl sm:leading-10">
312 Wow, you've come a long way!
313 </h2>
314 <div className="mt-8 flex lg:flex-shrink-0 md:mt-0">
315 <div className="inline-flex rounded-md shadow">
316 <Link href="/overview">
317 <a className="inline-flex items-center justify-center text-center px-5 py-3 border border-transparent text-base leading-6 font-medium rounded-md text-white bg-coral hover:bg-coral-light focus:outline-none focus:shadow-outline transition duration-150 ease-in-out">
318 Okay, let's get started!
319 </a>
320 </Link>
321 </div>
322 <div className="ml-3 inline-flex rounded-md shadow">
323 <a
324 href={siteConfig.repoUrl}
325 className="inline-flex items-center justify-center text-center px-5 py-3 border border-transparent text-base leading-6 font-medium rounded-md text-coral bg-white hover:text-coral-light focus:outline-none focus:shadow-outline transition duration-150 ease-in-out"
326 >
327 Take me to the GitHub repo.
328 </a>
329 </div>
330 </div>
331 </div>
332 </div>
333 <Footer />
334 <style jsx global>{`
335 .gradient {
336 -webkit-mask-image: linear-gradient(
337 180deg,
338 transparent 0,
339 #000 30px,
340 #000 calc(100% - 200px),
341 transparent calc(100% - 100px)
342 );
343 }
344 `}</style>
345 </div>
346 </>
347 )
349​
350export default Home
351Home.displayName = 'Home'
352const Check = React.memo(() => (
353 <svg
354 fill="none"
355 stroke="currentColor"
356 strokeLinecap="round"
357 strokeLinejoin="round"
358 strokeWidth="3"
359 className="w-3 h-3"
360 viewBox="0 0 24 24"
361 aria-hidden="true"
362 >
363 <path d="M20 6L9 17l-5-5"></path>
364 </svg>
365))