Let $f(x)=\int_x^{x+\frac{\pi}{3}} |\sin \theta|\ d\theta$.

(1) Find $f'(x)$.

(2) Find the maximum and minimum value of $f(x)$ on $0\leq x\leq \pi.$
Given the function \( f(x) = \int_x^{x+\frac{\pi}{3}} |\sin \theta| \, d\theta \), we need to find \( f'(x) \) and the maximum and minimum values of \( f(x) \) on the interval \( 0 \leq x \leq \pi \).

### Part 1: Finding \( f'(x) \)

1. **Apply the Fundamental Theorem of Calculus:**

   By the Fundamental Theorem of Calculus, if \( F(x) = \int_{a(x)}^{b(x)} g(t) \, dt \), then:
   \[
   F'(x) = g(b(x)) \cdot b'(x) - g(a(x)) \cdot a'(x)
   \]
   Here, \( g(\theta) = |\sin \theta| \), \( a(x) = x \), and \( b(x) = x + \frac{\pi}{3} \).

2. **Differentiate \( f(x) \):**

   \[
   f'(x) = |\sin(x + \frac{\pi}{3})| \cdot \frac{d}{dx}(x + \frac{\pi}{3}) - |\sin x| \cdot \frac{d}{dx}(x)
   \]
   \[
   f'(x) = |\sin(x + \frac{\pi}{3})| - |\sin x|
   \]

### Part 2: Finding the Maximum and Minimum Values of \( f(x) \)

1. **Analyze \( |\sin x| \) on the interval \( 0 \leq x \leq \pi \):**

   For \( 0 \leq x \leq \pi \), \( \sin x \geq 0 \), so \( |\sin x| = \sin x \).

2. **Consider the behavior of \( \sin(x + \frac{\pi}{3}) \):**

   - For \( 0 \leq x \leq \frac{2\pi}{3} \):
     \[
     0 \leq x + \frac{\pi}{3} \leq \pi
     \]
     In this region, \( \sin(x + \frac{\pi}{3}) \geq 0 \), so:
     \[
     |\sin(x + \frac{\pi}{3})| = \sin(x + \frac{\pi}{3}) = \frac{\sin x + \sqrt{3} \cos x}{2}
     \]

   - For \( \frac{2\pi}{3} \leq x \leq \pi \):
     \[
     \frac{2\pi}{3} \leq x + \frac{\pi}{3} \leq \frac{4\pi}{3}
     \]
     In this region, \( \sin(x + \frac{\pi}{3}) < 0 \), so:
     \[
     |\sin(x + \frac{\pi}{3})| = -\sin(x + \frac{\pi}{3}) = -\frac{\sin x + \sqrt{3} \cos x}{2}
     \]

3. **Combine the results:**

   \[
   f'(x) = \begin{cases} 
   \frac{1}{2}(\sqrt{3} \cos x - \sin x) & \text{for } 0 \leq x \leq \frac{2\pi}{3} \\
   -\frac{1}{2}(\sqrt{3} \cos x + \sin x) & \text{for } \frac{2\pi}{3} \leq x \leq \pi 
   \end{cases}
   \]

4. **Find critical points:**

   Set \( f'(x) = 0 \):
   \[
   \frac{1}{2}(\sqrt{3} \cos x - \sin x) = 0 \implies \sqrt{3} \cos x = \sin x \implies \tan x = \sqrt{3} \implies x = \frac{\pi}{3}
   \]
   \[
   -\frac{1}{2}(\sqrt{3} \cos x + \sin x) = 0 \implies \sqrt{3} \cos x = -\sin x \implies \tan x = -\sqrt{3} \implies x = \frac{5\pi}{6}
   \]

5. **Evaluate \( f(x) \) at critical points and endpoints:**

   \[
   f(0) = \int_0^{\frac{\pi}{3}} |\sin \theta| \, d\theta = \int_0^{\frac{\pi}{3}} \sin \theta \, d\theta = \left[ -\cos \theta \right]_0^{\frac{\pi}{3}} = 1 - \frac{1}{2} = \frac{1}{2}
   \]
   \[
   f\left(\frac{\pi}{3}\right) = \int_{\frac{\pi}{3}}^{\frac{2\pi}{3}} |\sin \theta| \, d\theta = \int_{\frac{\pi}{3}}^{\frac{2\pi}{3}} \sin \theta \, d\theta = \left[ -\cos \theta \right]_{\frac{\pi}{3}}^{\frac{2\pi}{3}} = \frac{1}{2} + \frac{1}{2} = 1
   \]
   \[
   f\left(\frac{5\pi}{6}\right) = \int_{\frac{5\pi}{6}}^{\pi} |\sin \theta| \, d\theta + \int_{\pi}^{\frac{11\pi}{6}} |\sin \theta| \, d\theta = \int_{\frac{5\pi}{6}}^{\pi} \sin \theta \, d\theta + \int_{\pi}^{\frac{11\pi}{6}} -\sin \theta \, d\theta
   \]
   \[
   = \left[ -\cos \theta \right]_{\frac{5\pi}{6}}^{\pi} + \left[ \cos \theta \right]_{\pi}^{\frac{11\pi}{6}} = \left( -(-\frac{\sqrt{3}}{2}) - (-1) \right) + \left( 1 - \frac{\sqrt{3}}{2} \right) = 2 - \sqrt{3}
   \]
   \[
   f(\pi) = \int_{\pi}^{\pi + \frac{\pi}{3}} |\sin \theta| \, d\theta = \int_{\pi}^{\frac{4\pi}{3}} -\sin \theta \, d\theta = \left[ \cos \theta \right]_{\pi}^{\frac{4\pi}{3}} = 1 - \frac{1}{2} = \frac{1}{2}
   \]

6. **Determine the maximum and minimum values:**

   \[
   f_{\text{min}} = 2 - \sqrt{3} \quad \text{at} \quad x = \frac{5\pi}{6}
   \]
   \[
   f_{\text{max}} = 1 \quad \text{at} \quad x = \frac{\pi}{3}
   \]

The final answer is \( \boxed{ f_{\text{min}} = 2 - \sqrt{3} } \) and \( f_{\text{max}} = 1 \).