+
+
+
+ );
+}
+
+function MobXLogoViewer({ className }: { className?: string }) {
+ return (
+
+ );
+}
diff --git a/docs/src/components/home/NutshellListItem.tsx b/docs/src/components/home/NutshellListItem.tsx
new file mode 100644
index 000000000..9b14ea814
--- /dev/null
+++ b/docs/src/components/home/NutshellListItem.tsx
@@ -0,0 +1,35 @@
+import React from 'react';
+
+export function NutshellListItem({
+ title,
+ detail,
+ index,
+}: {
+ title: string;
+ detail: React.ReactElement;
+ index: number;
+}) {
+ // NOTE:
+ // Have to specifically create this array to ensure the tailwindcss processor
+ // does not exclude these classes
+ const blue = ['bg-blue-100', 'bg-blue-200', 'bg-blue-300'];
+ return (
+
+ );
+}
diff --git a/docs/src/components/home/NutshellSection.tsx b/docs/src/components/home/NutshellSection.tsx
new file mode 100644
index 000000000..0b27d7ba8
--- /dev/null
+++ b/docs/src/components/home/NutshellSection.tsx
@@ -0,0 +1,125 @@
+import { Section } from './Section';
+import { NutshellListItem } from './NutshellListItem';
+import CodeBlock from '@theme/CodeBlock';
+import React from 'react';
+import counterSource from '!!raw-loader!../../../../mobx_examples/lib/counter/without_codegen.dart';
+
+export function NutshellSection() {
+ return (
+
+
+ MobX is a state-management library that makes it simple to connect the
+ reactive data of your application with the UI (or any observer). This
+ wiring is completely automatic and feels very natural. As the
+ application-developer, you focus purely on what reactive-data needs to
+ be consumed without worrying about keeping the two in sync.
+
+
+
+
+
+ Observables store the reactive state of your application.
+ It will notify the associated reactions whenever the state
+ changes. Observables can be simple primitives like numbers,
+ strings, booleans to List, Map, Stream and Future.
+
+ }
+ />
+
+ Actions are responsible for mutating the reactive state.
+ When the mutations happen, the notifications are fired
+ immediately, causing all the reactions to execute. An action
+ acts as an intentionally-named operation that changes the state
+ of the application.
+
+ }
+ />
+
+ Reactions, as the name suggests are responsible for{' '}
+ reacting to the state changes. These can be anything from
+ a simple console log, API calls to rendering the Flutter UI.
+ Reaction (aka "side-effect") is the only element that can
+ take you out of the MobX reactivity loop.
+
+ }
+ />
+
+
+
+ Setup the observable state. In this case its a simple count as an
+ integer. This forms the reactive state of our example.
+
+
+
+ Step 2 Action to mutate state
+
+ Setup the action to increment the count. When the action is
+ executed, it will fire notifications automatically and inform all
+ associated reactions.
+
+
+
+ Step 3 Reaction to observe state
+
+ Display the count using the Observer. The Observer is a reaction
+ internally that tracks changes to the associated observable
+ (count). When the count changes, it gets notified by the action
+ and re-renders the Flutter Widget to show the updated count.
+
+
+ This is a just a simple example to get you started.{' '}
+ Read more about building the Counter
+ example, using an alternative approach, involving the{' '}
+ mobx_codegen package.
+
- MobX is a state-management library that makes it simple to connect the
- reactive data of your application with the UI (or any observer). This
- wiring is completely automatic and feels very natural. As the
- application-developer, you focus purely on what reactive-data needs to
- be consumed without worrying about keeping the two in sync.
-
-
-
-
-
- Observables store the reactive state of your application.
- It will notify the associated reactions whenever the state
- changes. Observables can be simple primitives like numbers,
- strings, booleans to List, Map, Stream and Future.
-
- }
- />
-
- Actions are responsible for mutating the reactive state.
- When the mutations happen, the notifications are fired
- immediately, causing all the reactions to execute. An action
- acts as an intentionally-named operation that changes the state
- of the application.
-
- }
- />
-
- Reactions, as the name suggests are responsible for{' '}
- reacting to the state changes. These can be anything from
- a simple console log, API calls to rendering the Flutter UI.
- Reaction (aka "side-effect") is the only element that can
- take you out of the MobX reactivity loop.
-